Friday, August 23, 2013

Hacker or Poet?

Most comments in source code are junk. They either state what the code does (what do you know, model.update() update's the model!) or get woefully out of sync. Plus, consistency in naming can go a heck of a long way (models/cart.php - hmmm, let's see, that's probably a data model for the cart). That's not to say that the occasional comment explaining *why* something is getting done (versus how; I can see how, that's what the code is for) isn't handy.

Oh, and they are occasionally useful for entertainment. This one feels like it has the makings of a lyric from a rap song, no? At the very least, it's got poetry written all over it.

// I’m a pacifist but when it comes to my code I’m a masochist
// Another day, another function, another ass to whip
// Rocking output functions cause they asked for it,
// I got cash to get

-- system/mojomotor/libraries/Mojomotor_parser/Mojomotor_parser_layout.php:98

2 comments:

  1. It takes away from the code.

    ReplyDelete
  2. > It takes away from the code.

    True. And I wouldn't let it live in any source tree that I maintained :-).

    But during a late night hacking session, it sure did make me smile.

    ReplyDelete