The pyramid of code quality (Part II), the 3 different types of codes.(makinggoodsoftware.com)
makinggoodsoftware.com
The pyramid of code quality (Part II), the 3 different types of codes.
http://makinggoodsoftware.com/2009/05/10/the-pyramid-of-code-quality-part-ii-the-3-different-types-of-codes/
3 comments
Over-engineering tends to happen when people plan out the entire structure of an application or codebase before starting.
Under-engineering happens when deadlines pile up and there is no time to refactor to known and useful design patterns. Or, in the worst-case scenario, the developer has no idea about design patterns. Most code out there is bad due to the latter two reasons, not the former one.
Over-engineered code, yes, is often denser than it needs to be. But oftentimes it's a lot easier to come in and understand it than, say, a 16000 line PHP file with no functions or objects - just a bunch of nested if/else... I'd argue that the former is possible to refactor, while you're better off just dousing the Gordian Knot code in kerosene and tossing a match on it.
Under-engineering happens when deadlines pile up and there is no time to refactor to known and useful design patterns. Or, in the worst-case scenario, the developer has no idea about design patterns. Most code out there is bad due to the latter two reasons, not the former one.
Over-engineered code, yes, is often denser than it needs to be. But oftentimes it's a lot easier to come in and understand it than, say, a 16000 line PHP file with no functions or objects - just a bunch of nested if/else... I'd argue that the former is possible to refactor, while you're better off just dousing the Gordian Knot code in kerosene and tossing a match on it.
Hah, so what you're saying is the "code that needs to be refactored" is actually "code that needs to be thrown away"... :-)
Sometimes, but not always! Often over-engineered code can simply be reorganized to something simpler and more intuitive (and oftentimes, more efficient). The same is usually not true of spaghetti code...
Hi swombat, thanks for your comment, I actually completely agree on what you say: "Over-engineered code is as much in need of a refactoring as under-engineered code" I should have also mention that on the original article. Good observation, thanks!!!!
I think that the point is that the ratio of framework to functionality code is a relevant indicator when evaluating overall code quality in an application or system.
Interesting topic, but hard to read ... is there a pyramid of good writing/grammar?
Hi callmeed and any other eventual reader, please accept my apologies for my bad writing in English, I hope you will understand it's not my native language and that I do my best, anyway, going forward I will try to get my articles reviewed from some native speaker guy before publishing them. Thanks for your comment!!!
In addition, this analogy is wrong. Over-engineered code is as much in need of a refactoring as under-engineered code.