Complexity prettified

09 Jan 2015 on
random

Ruby community is influenced with Rails opinions of conveniences and conventions. Ruby became popular through Rails and its huge influence is unsurprising. Popularity of DSLs among Rubyists is also unsurprising.

DSLs improve expressiveness, but it comes with a price. They add a layer of complexity that comes naturally with implicit code. Instead of providing truth, they provide convenience. DSL is essentially a syntactic sugar that takes you away from the actual implementation.

Strive for the expressiveness of that narrow public facing API, instead of faking it with pretty DSLs on top. We are Rubyists, damn it - we understand Ruby. The forgotten language buried deep inside your overly expressive castle of syntactic sugar.

Don't throw all DSLs into a volcano for the time being, they are still pretty useful if their domain of usage is small. Any sort of configuration is a perfect scenario for using a small DSL. Just keep in mind that any kind of convenience comes with a price, a price that not everyone is willing to pay.