Wrestling with pure evil

1.) Very long method


+


2.) Non descriptive variable names



3.) Variables are reused for different things throughout the method



4.) Lots of if/then exception cases


+


5.) Deeply nested Arrowhead code


+


6.) All data stored in Hashtable’s — and it’s this data that’s getting bamboozled somewhere


+


7.) Numbers that come out wrong


=


An unpleasant Friday afternoon. 


I worked with a developer one time who took an inordinate amount of pride in his debugging prowess and ability to make bad code function.  I could have really admired his ability if I hadn’t been so busy cursing him for the code I inherited from him.  I think I’m getting more tolerant of other people as I get older, but less tolerant of bad code and code friction.


The next time I do greenfield development I promise to appreciate it.

About Jeremy Miller

Jeremy is the Chief Software Architect at Dovetail Software, the coolest ISV in Austin. Jeremy began his IT career writing "Shadow IT" applications to automate his engineering documentation, then wandered into software development because it looked like more fun. Jeremy is the author of the open source StructureMap tool for Dependency Injection with .Net, StoryTeller for supercharged acceptance testing in .Net, and one of the principal developers behind FubuMVC. Jeremy's thoughts on all things software can be found at The Shade Tree Developer at http://codebetter.com/jeremymiller.
This entry was posted in Ranting. Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • http://www.backlinkschecker.ws/backlinks/buylinks.html Purchase High PR Backlink

    It is  a great opportunities.

  • http://codebetter.com/blogs/jeremy.miller Jeremy D. Miller

    if
    {
    if
    {
    foreach (…)
    {
    if
    {
    while (…)
    {

    and back down again. The simple cure is Composed Method. http://codebetter.com/blogs/jeremy.miller/archive/2006/12/03/Composed-Method-Pattern.aspx

  • Ollie

    Arrowhead code? – care ot explain…

  • http://codebetter.com/blogs/jeremy.miller Jeremy D. Miller

    Mike,

    The code isn’t really that old, but it was written by an analyst, not a developer. The analyst wasn’t given any help from a developer at the time.

    All of the absolute worst code is written by very bright, very creative people without experience. The real failing of that organization was putting somebody in a position to fail.

  • Mike

    What year was the code origionally written?

  • http://codebetter.com/blogs/jeremy.miller Jeremy D. Miller

    …no tests & not knowing what the code’s supposed to do == no refactoring

  • Vlad

    Just refactor…

  • http://weblogs.asp.net/bsimser Bil Simser

    Sucks to be you. Just kidding. Sounds like a crappy way to end the week, but look on the bright side.

    It could be Monday.

  • http://codebetter.com/blogs/david_laribee/ Dave Laribee

    i think your complaint/solution ratio speaks for itself.

  • http://codebetter.com/blogs/jeremy.miller Jeremy D. Miller

    G,

    To make amends, I’ve got a post in the pipeline that’s all about fixing/preventing the stuff I was whining about today. Look for it soon.

  • MToddSmith

    Sounds like job security 101 to me :D

  • Harry

    Hey, I learned something. To code-better, I have to avoid things listed here.

    This is a good post.

  • G

    Posts like this don’t teach anyone to “codebetter”, they seem to just be a forum for you to bitch about your current projects.