Hacker News new | ask | show | jobs
by pmontra 1754 days ago
That's a matter of developer discipline and foresight. I've be managing a Rails project since late 2011 (that's my longest run so far), usually adding a few features per year and fixing bugs, mostly alone or with another developer. If I put too much magic into the code I'd spend much of my time figuring out what I did months ago. Instead I can usually read my code from 2011 / 2012 and understand what it does. The puzzling exceptions are not so exceptional: I'm having the same experiences with the other code bases I'm working on (Python, Elixir.)

So in doubt no metaprogramming. Example: I never wrote a macro in a real world Elixir project.

1 comments

I can't say anything about the number of featurea, that's entirely business driven, but of course you shouldn't be writing macros in Elixir on a standard application.

But it's not abnormal for a rails codebase to have a Concern (rails module) that provides a class method that does something, specific to the application. Which is equivalent to a macro.