Skip Links

Network World

Programmers need to *always* validate input

30+ years ago, when I took Computer Science 100 in college, one of the important lessons was that you should *never* trust input, and we had to run our homework programs on maliciously designed data (especially useful for finding off-by-one errors.)

The main causes of stack overflow are input routines that don't check how much data you're handing them, and there's simply no excuse for allowing that in professional code. I'm guessing that the buggy programs were written in C - it's a beautiful efficient language, but it *will* let you shoot yourself in the foot - or else in some variant like C++ or C#, which offer you better-protected data structures but still let you use the old-fashioned ones.

Click to read the article this is in response to.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You can use BBCode tags in the text.
  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <p> <strong> <i> <br /> <br> <ul> <ol> <li> <dl> <dt> <dd> <blockquote>

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Welcome, visitor. Register Log in