My web-titan send me a link to this webpage about
Hope-Driven Development. There's a lot of truth to the story and it is no wonder that checking incoming variable values is a part of
Tick-the-Code method. As a matter of fact, there are two relevant rules in the method; NEVERNULL and CHECK-IN.
NEVERNULL asks checkers to
tick the first statement in a function to dereference a pointer without first validating it isn't NULL. Otherwise all hell breaks loose, when the system is executed. And that is the
best case scenario. In a much worse situation, the system doesn't crash and seems to work fine. It does, however, hot work quite correctly and the longer it takes for the developers to notice, the harder it is for them to figure out what exactly is broken.
Pointers are special, because their side-effects and symptoms can be extremely insidious, but there are other components and values in source code, too. Variables of other types can also assume wrong values and if the developers assume that that never happens, chaos will ensue.
Assuming makes an ass out of you and me.
Rule CHECK-IN makes checkers in code review locate all places where a variable is used without first checking its sanity. Once again, not all variable values can be even roughly checked, but a conscious risk is preferable to ignorance every time.
---
The day started in Sophia Antipolis with a downpour of such intensity that cats and dogs are far too little and few in number to describe the dawning waterfall. Walking to a nearby bus stop with an umbrella was still enough to melt the creases off my trousers. The sloshing sound in my shoes became more of a squeak once I entered the customer's building, where I managed to perform a test ticking regardless. I had
a strong sense of déjà vu - only appropriate, what with me being in France - that
just two weeks ago I had wondered dripping wet the unknown streets of Sophia Antipolis, having stepped out of the bus six stops too early, without a map or an idea which way to go. The flu that had started to bother me the day before, didn't improve my situation. So much for first impressions, now was my last day in Sophia Antipolis, for now, and it was showing me its fluidier side.
It doesn't rain often in Southern France, but it rains a lot. You deduce how drizzly the rainshowers must be.
---
I'm now in Nice, although going to Cannes did occur to me. There's some kind of
film festival there.
Labels: Tried to come up with a witty film-related title without success