Friday, January 14, 2005

 

Little Thoughts About Programming...

Programming's all about assumptions.

Today I found an error in my logic that went a little something like this:

Please tell me if anything in this LIST
okay, since there are some things in that LIST, tell me about THIS ASPECT of
THIS ONE

when of course it SHOULD have looked like:

Please tell me if anything in this LIST
Okay, since there are some things in that LIST, is THIS ONE in that list?
Okay, since THIS ONE is in the list, tell me about THIS ASPECT of it.
Foolish. It took me over an hour to search this problem out because the debugger can't tell me anything about THIS ONE when I step through the program because it's a Java object (and .NET object don't know much about Java objects)

The problem with all this is that if you don't assume enough (not frequently enough, or don't try encompass enough in your assumptions) you can't get anything done because everything's a special case, whereas if you assume too much (as in my example above) you run into mistakes. It's a fine line. We programmers are all a bunch of highly skilled line-walkers.

Comments:
that's weird...
 
Post a Comment



<< Home