Code beauty vs. Obsession

When does the search for beautiful code become an obsession?

Rightly so, David Heinemeier Hansson 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 ;)

7 comments ↓

#1 Jamie Hill on 03.27.06 at 11:23 am

I’ll take your word for it.

#2 gunnar on 04.05.06 at 8:26 am

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

#3 Jamie Hill on 04.05.06 at 11:03 am

gunnar: I completely agree, this must just be a phase I’m going through. I suppose this is more unnecessary syntactical beauty?

#4 UncleD on 04.11.06 at 9:41 am

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

#5 Maz on 08.06.06 at 5:57 pm

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

#6 Jamie on 08.06.06 at 11:17 pm

Maz: Glad I’m not the only one ;)

#7 dwoodman on 09.21.06 at 9:20 am

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 Comment