Tue, 10 Aug 2004
If statements and duplication
I'm a big fan of hearing little stories that lead to little
lessons. Being good at a craft requires knowing a whole slew of little
lessons and having your mind be primed to pull them into action.
Here's a nicely put
little lesson from
Therefore it seems to me that there are two kinds of conditional
statement in a codebase: The first kind tests an aspect of the running
system's external environment (did the user push that button? does the
database hold that value? does that file exist?). And the second kind
tests something that some other part of the system already
knows. Let's ban the second kind...
## Posted at 07:02 in category /coding