Ask Slashdot: What Makes Some Code Particularly Good?
itwbennett writes: When developers talk about what makes some source code particularly 'good,' a handful of qualities tend to get mentioned frequently (functional, readable, testable). What would you add to this list?
> Code needs to fail in an easy to understand and predictable way.
:-)
Being written in C++ is a sure way to guarantee both!
Did it fail in an easy to understand way? Yes. It is easy to understand that it failed because it was written in C++.
Was it predictable that it would fail? Again, yes.
Those who fail to learn from history are doomed to be promoted to a decision making role.
I'll see your senator, and I'll raise you two judges.
Let's let at the clusterfuck of Boost's CRC code
1109 lines of over-engineered C++ crap for a simple CRC32 function!?!?
Now compare that to these simple 27 lines of C/C++ code.
Typical bloated code solves some theoretical "general purpose" solution. Good code does one thing well:
It communicates clearly what it is trying to do.
_When_ was the last time you actually needed a different CRC function from the standard 32-bit one?