Rants, rambles, news and notes from another geek

Depending on Undefined Behavior

It is interesting how often we see this in software development. A developer tries something and it works. Subsequently, in his mind, that is how the system works. Little does he know, that he is actually now dependent on a behavior that is documented as undefined.

Undefined == unpredictable

What can we learn from this?

If it isn’t documented, don’t use it. Just because you haven’t seen it change doesn’t mean it won’t. Plan on it.

It reminds me of something a professor said in one of my philosophy classes (I was a philosophy minor). He was talking about how people try something once and make huge generalizations about the results. In his story a woman’s (sic) car breaks down. She doesn’t know what to do, so she gets out and opens the hood. She pokes around for a minute or two… gets frustrated and kicks the tire. She then closes the hood and tries to start the car. When it starts, she has “learned” that opening the hood and kicking the tires will fix the car. Little does she know that she actually had a vapor lock.