By mswatcher
via davybrion.com
Published: Jul 23 2011 / 14:38
I've had some interesting discussions with other developers about writing code recently. I often have the impression that some developers put too much emphasis on clean code. Don't get me wrong, i strive for clean code as well, and have written about its importance quite a lot in the past couple of years. But when i'm coding, clean code is my secondary goal and it could never take the place of my primary goal: making it work. And preferably, i want to make it work great.



Comments
javakata replied ago:
This is true and should also be extended to the situations were patterns are overused in order to achieve clean code to the detriment of performance, readability etc. The database loop example the guy gives is something that happends so often, it makes you wanna cry. I've had 7-8 yeard old experienced developers lecturing me about "clean and structured code, not one line not belonging to this or that pattern" and then getting their code that used like visitors and coarse grained/fine grained DTOs (aspect managed none the less), to load a list of entities with ALL their properties and associations for display in a list, and then reloading each one when it was clicked inside that list to have all the previously loaded properties and associations displayed. And when (ofcourse) the performance issue hit, they added even more pattern based code and other crap to make some kind of in memory cache for those objects that were retrieved 5 times over and over each. And no, it was not the fault of the ORM "hiding the complexities and forcing wide eyed innocent developers inadvertently write bad code" because there was no ORM or database to speak of, it was a plain old Alfresco repo that just returned tuples for all your values.
Voters For This Link (13)
Voters Against This Link (1)