Ayende recently posted a an article titled “Where is the bug”. While reading the comments, I was disappointed by some of the answers to Ayende’s request to find the bug. Here are two of the comments that stood out to me:
- “You could argue the biggest bug is the use of a switch statement as it violates OCP.“
- “The use of a switch statement is a bug in itself.“
What bothers me so greatly is people’s inability to separate design discussion with bugs. A bug is defined on Wikipedia as:
A software bug is the common term used to describe an error, flaw, mistake, failure, or fault in a computer program or system that produces an incorrect or unexpected result, or causes it to behave in unintended ways
The two comments above don’t attempt to solve the bug and instead take an “ivory tower approach” to the problem (more befuddling is that removing the switch in favor of something else would leave the bug in place). This bugs me because we (as an industry) continue to care very little about the output and meeting of customer/business needs and more about code structure and semantics than actually working code.
Let me state for the record, it is perfectly acceptable to talk about code structure and design but please let’s not confuse a bug – an actual error or flaw in code – with poor design.
(I think it’d be humorous for Ayende to post some perfectly fine code and ask “Where’s the bug” and watch people trip over themselves trying to find something wrong)
Posted
11-25-2010 9:37 PM
by
Tim Barcz