Hacker News new | past | comments | ask | show | jobs | submit login

I don’t know Ruby but I’ve been a huge fan of Lisp macros (Clojure).

As with all abstraction mechanisms, you avoid them until you need them. When you do need them, they become a force multiplier.

A lot of macros can be avoided with data driven programming, which is likely one of the strongest techniques in terms of cost/benefit.

A light form of meta programming is source code generation (often used in tandem with data driven). It lets you have macro-like power, but the guts are spilled out for you to modify further or reason about easily. In some languages it’s the only thing you can do at that abstraction level.

In any case, meta programming is very powerful. But its quality and utility hinges on you to avoid it until you exhaust all of the lower level techniques. Else you end up with the worst kind of wrong abstraction.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: