Your code sucks because…

I rediscovered this article while doing some research. It gives an extensive list of reasons why your code sucks.

About these ads

3 thoughts on “Your code sucks because…

  1. Michael

    “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 !

    Reply
  2. Duane

    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. :)

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s