Jeremy D. Miller -- The Shade Tree Developer

Sponsors

The Lounge

Syndication

News

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
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.


Posted Fri, Sep 21 2007 2:12 PM by Jeremy D. Miller
Filed under:

[Advertisement]

Comments

G wrote re: Wrestling with pure evil
on Fri, Sep 21 2007 4:15 PM

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

Harry wrote re: Wrestling with pure evil
on Fri, Sep 21 2007 4:23 PM

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

This is a good post.

MToddSmith wrote re: Wrestling with pure evil
on Fri, Sep 21 2007 4:41 PM

Sounds like job security 101 to me :D

Jeremy D. Miller wrote re: Wrestling with pure evil
on Fri, Sep 21 2007 6:03 PM

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.

Dave Laribee wrote re: Wrestling with pure evil
on Fri, Sep 21 2007 6:15 PM

i think your complaint/solution ratio speaks for itself.

Bil Simser wrote re: Wrestling with pure evil
on Sat, Sep 22 2007 12:23 AM

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.

Vlad wrote re: Wrestling with pure evil
on Sat, Sep 22 2007 5:18 PM

Just refactor...

Jeremy D. Miller wrote re: Wrestling with pure evil
on Sat, Sep 22 2007 5:37 PM

...no tests & not knowing what the code's supposed to do == no refactoring

Mike wrote re: Wrestling with pure evil
on Sun, Sep 23 2007 10:44 AM

What year was the code origionally written?

Jeremy D. Miller wrote re: Wrestling with pure evil
on Sun, Sep 23 2007 11:31 AM

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.

Ollie wrote re: Wrestling with pure evil
on Mon, Sep 24 2007 11:49 AM

Arrowhead code? - care ot explain...

Jeremy D. Miller wrote re: Wrestling with pure evil
on Mon, Sep 24 2007 12:15 PM

if

{

   if

   {

       foreach (...)

       {

           if

           {

                while (...)

                {

and back down again.  The simple cure is Composed Method.  codebetter.com/.../Composed-Method-Pattern.aspx

Rob Conery wrote You’re Not Your Data Access
on Thu, Jun 11 2009 11:52 PM

Seems I touched off a bit of a “swirl” with a comment I made on my last blog post: I think, in general

Add a Comment

(required)  
(optional)
(required)  
Remember Me?