News for hackers. Stuff that matters.
Re:Ten years without Elixir by pmontra on Thursday January 14, 2021 @03:04AM (#25773506)
To add a data point: Ruby and Elixir developer here (and Python and JS). I never wrote a macro in Elixir. All that weird quote / unquote stuff is too complicated. I get the idea (code running at compile time) but the syntax is just unwelcoming. Furthermore macros tend to make code opaque and onboarding difficult. I could wake in terror if I dream of my coworkers implementing some new functionality by adding macros instead of functions.
Re:Ten years without Elixir by 1_player on Thursday January 14, 2021 @09:19AM (#25776498)
Agreed. My approach is to use macros written by someone smarter than me (Ecto), but refrain from writing macros myself. Regular functions very often are enough.

Macros are definitely abused, but there are some cases, fewer than you think, where they make code easier to follow.