David Masover
8/5/2008 4:49:00 AM
On Monday 04 August 2008 22:25:35 Daniel Berger wrote:
> Can you say "Job Security" boys and girls?
Ruby is already flexible enough to cause that problem -- or have that benefit,
depending on your point of view.
There just seems to be a general consensus that DSLs can work, if used
judiciously. No one seems to have a problem with, say, Sinatra:
get '/' do
'Hello, world!'
end
The only change here, I think, is that we can now do things like:
get /
'Hello, world!'
end
Or, for the more Python-inclined, drop the 'end'. And that's a very basic
example -- wouldn't it be nice if, when configured to use Haml as a
templating language, we could do:
get /
%h1.greeting
Hello, world!
Ok, probably a bad idea to make this the default, as in this example, but you
get the idea. Markaby is a cool concept, but at the end of the day, Haml just
feels cleaner. It also makes the point for very tightly-defined DSLs with
very odd syntax -- and this happens anyway, with Haml, whether or not Ruby
makes it easy.
I do see a point for Ruby's approach, though, in that I can get reliable
editor coloring, and I can, at a glance, and without reading documentation,
have an indication of what's going on -- at which things are part of the app,
which are part of the framework, and which are part of the language.