2007-05-14
"I am using Ruby based DSL’s for a number of tasks in my current project. But one day it struck me - am I using the right tool for the job, could there be a better, more simple solution?
Some DSL’s I use are simply declarative and look something like this:
quiz "Let's ask stuff" do question "What is 1+1?" do alternative "2", :correct => true alternative "3" end question "Vad is 2+3" do alternative "1" alternative "Infinity" alternative "Don't know" alternative "5", :correct => true end end I find that quite readable, but it requires me to maintain code that handle the DSL."