Flexibility is bad design
2008-07-01 13:18:45.24108+00 by
Dan Lyke
2 comments
Amen, brother: Flexibility is bad design (Via Mars).
In my opinion, good design is whatever results in a shipping product, using the least amount of code, in the least amount of time. This definition won't allow you to say what the best design is, but it does give you a rubric to pit two actual designs against each other. Less code is always better than more code because it will always be more readable, easier to digest, and easier to maintain.
[ related topics:
Software Engineering
]
comments in ascending chronological order (reverse):
#Comment Re: made: 2008-07-01 14:28:03.708523+00 by:
ebradway
[edit history]
Less code is always better...it will always be more readable
PHhhPTTHHFFFFF..... Bull shit.
Ever read some of meuon's (or even Dan's) regex? It's one line of code - it works - it's read-only - and it'll take someone not steeped in the intricacies of regex days to figure out what it's doing.
Same goes for finite state machines. They are elegant as all get-out and compress code down amazingly but they can be a bitch to reverse-engineer.
Given any piece of code that is readable, I can reproduce its functionality in less code.
But the basic argument is the one of the tenants of Extreme/Agile programming: don't bother to build for future expansion. It actually doesn't work in code!
#Comment Re: made: 2008-07-02 00:42:25.916771+00 by:
John Anderson
Agreed, the article would have been improved if it had referenced the original principle in XP terms: YAGNI (You Aren't Gonna Need It). The argument is your code should do just what it needs to do at the moment, and you should trust that if it nedes to do something else, or something additional, at some later point, you'll figure that out and put it in at that point.
That's not quite the same thing as "flexibility bad".