Archive for October, 2006
Ruby DSL's
Obie Fernandez posted his slides from his JAOO presentation.
My favorite slide:
“The fascinating thing is that, in my
experience, most well-written Ruby
programs are already a DSL, just by
nature of Ruby’s syntax.â€
Jamis Buck, 37signals
Part of my hangup with the DSL “movement” as of late has been, “are we really making DSL’s here, or just nice clean API’s?” Jamis’ quote, in my interpretation, sort of backs that up. I’m probably taking it totally out of context. Regardless, it’s fun to get worked up about DSL’s, it makes you feel like you’re writing a fancy language, instead of yet another interface. Whatever gets you fired up about making clean code is a good thing.
I don’t mean to sound cynical, I’ve been waging a personal war against cynicism. This isn’t a “why bother calling these DSL’s” speech, it’s a “YOU’RE SMARTER THAN YOU THINK” speech. DSL’s aren’t mystical, at least not in the Ruby world. They’re just clean code.
Edited to add: I found Jamis’ entry that the quote was taken from, I didn’t get the context of the quote wrong, as this quote, “A DSL can be thought of as (and many cases, really is) an API for your application.” sort of proves. So…that’s good.