Saturday 28 July 2007

80 characters long line is gone

I remember that not so long ago everyone was saying that a line of code should not be longer then 80 characters. The problem with this approach is that it leads you to cryptic method/class/variable names because of the 80 characters hard limit. I could justify that rule back in the epoch of 15 inch CRT monitors because there are not too many things more annoying then constant scrolling from right to left and left to right to be able to read a piece of code. But even nowadays there are people who would stick with that rule which doesn't make sense for me because it's just a waste of space of your 17/19/20 or 24 inch LCD monitor. 24 inch is a really great one and 2 of them are just brilliant :).

2 comments:

  1. Luckilly I never heard about it, hence my self commenting code :)

    $r = $d->c->e($s); won't say much without a comment, but
    $resultSet = $db->connection->execute($sql); doesn't need one.

    Rules are made to be broken.

    ReplyDelete
  2. Code like that drives me nuts and my behaviour gets out of control :)

    ReplyDelete