Again, I’m going to continue to use “hack” in ye olde sense of interesting and/or excellent coding. And in this context, we’ll let “development” stand for the sort of coding you might do at work; something businessey, something enterprisey. It’s all good. I’ve been writing about this a lot. I hope that’s okay.

I wrote something called Considered harmful considered harmful not too long back, basically leapfrogging from a post _why made on hackety.org.

I saw an example today in the Ruby Programming Language book by Matz and David Flanagan that really makes it easier to get at the point I was trying to reach.

In the first chapter, they have a ruby Sudoku solving program, as an example of a little bit longer chunk of ruby code. I’m a sudoku nut, so I started picking it a part to see how it worked. Then I arrived at:

      # ...Writing dense code
      # like this is probably not good coding style, but it demonstrates
      # the power and expressiveness of the language.
      (0..8).collect{|r| @grid[r*9,9].pack('c9')}.join("\n").tr(BIN,ASCII)

(BIN and ASCII, in the above example, are string constants, ASCII = ".123456789" and BIN = "\000\001\002\003\004\005\006\007\010\011" respectively.)

Now, I’m not going to talk about how the snippet works — I’ll let you explore that on your own if you like that sort of thing. I was struck by the comment: Writing dense code like this is probably not good coding style, but it demonstrates the power and expressiveness of the language.

Yes it does. But that line makes very clear the tension between hacking (this is fun and interesting!) and developing (this is sober, and let’s make sure nothing clever works its way into the code).

In my mind, the comment read something like this:

LOOK AT THE REALLY COOL THINGS YOU COULD DO WITH RUBY. NOW, YOU ARE NOT ALLOWED TO EVER USE THIS IN REAL LIFE.

What?

Now, that’s just mean.

Sorry, comments are closed for this article.