Previous Entry Share Next Entry
12:19 am, 25 Aug 08

on being too clever

One thing I like about writing C (and the nearly-equivalent restricted subset of C++) is how stupid the language is. It's counterintuitive at first, but because of the weak expressive power of C it's rare to have more than a few ways to do something: first you allocate some memory, then you fill it in, maybe with a loop, and then you return it.

Contrast it with higher-level languages. You see a pattern and you start to generalize. The Lisp people want to start with writing a system of macros; the Ruby people want to start "metaprogramming DSLs"; the Perl people start shoehorning in OO or Moose; in Haskell I start thinking I could write the code more point-free or with monads or with arrows or (today's new technology flavor!) applicative functors.

At some point you have to draw the line, but it's never quite clear where. Is this shortening leading to clarity or to golfing? With C, it's easy: you always just do it the stupid and verbose way. I wonder if this is part of the appeal of Java.