Hacker News new | ask | show | jobs
by specialp 1300 days ago
It looks clean because the developers are also the people behind dry-rb. However, I made one production service in Hanami and never again. They put clean syntax above all else. This results in a TON of metaprogramming with very weird results. There were times when a variable name I was using in my code was conflicting with a method called in one of the many `instance_evals` to achieve such "dryness" I really do like the structure though with repositories for data.

Overall I think the focus with clean syntax/DSLs in Ruby projects with pervasive metaprogramming is one of the reasons the code is so hard to maintain.

3 comments

    Overall I think the focus with clean syntax/DSLs 
    in Ruby projects with pervasive metaprogramming 
    is one of the reasons the code is so hard to maintain.
I don't have any opinion on Hanami and don't want to bring any negativity to the Hanami 2.0 party. Congrats to the team on this release!

However, in general, I wholeheartedly agree with your statement. Sometimes Ruby frameworks get way too cute with the metaprogramming.

What you're describing should've been reported as a bug because we do use metaprogramming for DSLs but the "runtime" objects are actually designed to have very minimalistic public API. I can assure you we do not put clean syntax above all else but we do like clean DSLs that reduce boilerplate
You might enjoy this project: https://github.com/garybernhardt/base

:-)