I rediscovered this article while doing some research. It gives an extensive list of reasons why your code sucks.
Author: Robert Watkins
My name is Robert Watkins. I am a software developer and have been for over 20 years now. I currently work for people, but my opinions here are in no way endorsed by them (which is cool; their opinions aren’t endorsed by me either). My main professional interests are in Java development, using Agile methods, with a historical focus on building web based applications. I’m also a Mac-fan and love my iPhone, which I’m currently learning how to code for. I live and work in Brisbane, Australia, but I grew up in the Northern Territory, and still find Brisbane too cold (after 22 years here). I’m married, with two children and one cat. My politics are socialist in tendency, my religious affiliation is atheist (aka “none of the above”), my attitude is condescending and my moral standing is lying down. View all posts by Robert Watkins
3 thoughts on “Your code sucks because…”
“have temporal duplication when the same work is done repeatedly when it doesn’t have to be. ”
That is more common then it sounds. Take a simple case of someone iterating through a DB resultset, populating a collection of model objects, and then the UI iterating throught the model collection to display it in a grid. It is not the system repeating “exactly” the same thing, but it is still repetition.
Of course, all the more reason for lazy loaded collections from hibernate, and keeping the session open until the UI has had its way with the model !
My very first programming job out of college I needed to start by fixing some code that was printing the footer of a report badly. I found the code, fixed the code, and ran the report. Bug still there. I was scratching my head over that one, staring at the code I’d just changed.
“Maybe that’s not the only place in the code where the footer is generated,” said the electrical engineer.
Took me awhile to grasp that concept, having freshly graduated from my academic world where everything is done by the book and one never cut and pastes one’s code. I ended up finding 6 different instances of the exact same printFooter() method scattered throughout the source code.
Of course I *never* do that now. 🙂
Why software doesn’t come cheap
Software is too expensive to build cheaply…
…because most code sucks, to put it bluntly. Whether or not you agree it’s definitely an interesting read. The article …