2 ms·
No, I don't have any formal statistics on defect rates and the occurrence of "else" and/or nested "if/else" constructs. I'll leave that to people who want to w
by bborud 16y ago
No, I don't have any formal statistics on defect rates and the occurrence of "else" and/or nested "if/else" constructs. I'll leave that to people who want to write papers and go to conferences. I'm more of a pragmatic person.
In fact, if I did present you with those statistics you should be even more wary because of the tendency of people to accept "research" without question. A good example is the "research" that has been done on pair-programming. The only conclusion I am able to reach from what I have read on the subject is that "it depends". Of course, I can interpret what has been published in ways that'll make the case both ways and mislead the uncritical reader to my liking :-).
I am also wary of what I call "dogmatic programming". Just because some "authority" says you should do something doesn't mean that it is correct or valid in other contexts. For instance something that is a good practice in Pascal might not be at all applicable in Lisp.
The concrete examples given in the blog posting may divert attention away from the main point I was trying to make about "red flags" and the need to stop and think. Indeed, most people who have commented on the posting (on Reddit and in email) seem to get hung up on the second, "cleaned up" form of the example given. My bad.