jeudi 15 janvier 2009

Beauty in code

We should write beautiful code.

Saying that of course begs the question, what is beautiful code? And I won't answer it... not really. We should write beautiful code because we are equipped with hardware that can tell really really fast if something is beautiful.

Beauty is not useless

Without getting into the usefulness of live, physical beauty is synonymous with sexy for really good reasons. It is supposed to be an indicator of health in us, humans. Facial asymmetry, for example, can be an indicator of brain damage in early life. Someone with a koala face has more chances of being healthy. I am not sure of that at all, but for the argument's sake, let's say it's true. {When you think about it, beauty is not in the eye of beholder. It's in the dick of the fucker :-) }

So, should we abandon the use of our consciousness in favor of our guts when programming? {Let's call that Colbert style} Kind of, I guess :-) It would be more fun for the guy creating the new code, that's for sure!

We can do something a little less stupid by teaching us what should be beautiful code. But how?

The first thing to do is to reject beauty as criteria when programming and conducting code inspections. There is no contradiction! If you surround yourself with code you feel is beautiful, than you get beauty for beauty's sake - that's circular and retarded. You should surround yourself with code that's right, with the hope that in time you'll get used to it. Familiar code quickly becomes beautiful.

If we ever get to the point where ugly code is probably wrong, life will be sweet! Coding will be so much easier - but don't get comfortable! You'll still have to refrain from rejecting code on the basis of ugliness, or your sense of beauty will drift and once again become your worst enemy.

2 commentaires:

Anonyme a dit...

...please where can I buy a unicorn?

Anonyme a dit...

I liked the article, but some disagree