Coding with good energy

I just read a post on planet.python.org about writing entertaining comments and docs, and I found the topic quite interesting. Above all I like my code to work, but I also like to code when I’ve generally got a good level of energy. In this respect I consider writing code an art, and I also think that the more sleep you get, the better mood you are in, the more accurate your code is going to be. I mean, when my tasks get boring I tend to get lazier and write crappier code.

This means that I really, really, like to add personality to my code. It should basically be as self-documenting as possible, so slapping in an occasional


def cludgy(*args):
""" I have no idea why I'm writing this, and if x
ever equals 0, you should probably double check mine.yoursForNow()
"""
x, y, z = args
return y

The more interesting, the better. In my opinion, better energy == better code == better art. I would say that with C/C++ you’ll end up writing more comments, but with python you have more opportunity to spice up your code since you are writing more faster.

By | 2008-08-29T00:08:00+00:00 August 29th, 2008|Uncategorized|2 Comments

2 Comments

  1. Anonymous June 19, 2009 at 9:40 pm - Reply

    What a horrible example. That’s just ugly code, not code with character. Like something I read on dailywtf.com, sorry

  2. Patricio June 19, 2009 at 9:48 pm - Reply

    well, it may be ugly code, but I think I made my point.

Leave A Comment

− 1 = 1