Code beauty vs. Obsession

h3. When does the search for beautiful code become an obsession?

Rightly so, “David Heinemeier Hansson”:http://www.loudthinking.com/arc/000419.html constantly pushes for beautiful code, however this in now becoming an obsession for me and I may soon need professional help…

You know things are getting bad when you do something similar to the following:

thing = {
  :store_dir => "public/master",
  :scaled_dir => "public/variants",
  :tmp_dir => "public/temp"
}

And then _have_ to change it so that the symbol names are the same length!!:

thing = {
  :storage_dir => "public/master",
  :variant_dir => "public/variants",
  :tmp_img_dir => "public/temp"
}

I am finding myself becoming more and more obsessional about stuff like this.

* Where is the threshold?
* When does code beauty become an obsession?

If anyone else is suffering from this terrible disorder, please post here, I need support to get through this ;)

Published by

Jamie

Hi, I am the Managing Director of SonicIQ Limited in the UK. I have been working in the web development industry since 1999 and have been running SonicIQ since 2001. Currently Ruby On Rails is my preferred development platform. I am experienced in designing with web standards, HTML5, CSS3 and Javascript.

7 thoughts on “Code beauty vs. Obsession”

  1. is it really beautiful code?
    imho beautiful code is code that easy to read, not that looks good at a distance ;P

  2. That’s right! You know what though, if you enjoy writing it that way and it remains readable, that’s what matters in the end. Do what will make you happy while you work.

    Best Regards

  3. You’re not alone. Particularly in reference to having the array elements all neatly aligned. They’re just far easier to read that way.

  4. Why not –

    thing = { 
      :store_dir  => "public/master", 
      :scaled_dir => "public/variants", 
      :tmp_dir    => "public/temp" 
    }
    

    If God had meant all variable names to be the same length, He would never have given us tabs!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>