Saturday 20 December 2008

I found this reason to use a DSL today, and it is the best reason to use a DSL I have heard of so far.

"DSL allows business people to read through code and understand what is going on, so they can spot misinterpreted requirements."

I wonder if it is true in practice?

1 comment:

Korny said...

I've read the text of a DSL out to a business person - not quite the business person reading the code, but close enough.

More often though, I use a DSL so *I* can read it :)

For example, my tests for a file management tool use a DSL for test data, that reads like:
TestDirBuilder.construct("root") do
  dir "parent" do
    dir "child" do
      file "grandchild", "12345"
    end
    dir "emptychild"
  end
end

somewhat more readable, by *me*, than building it in code!