Much smarter people than me value the macro concept - and from my own shallow understanding - I appreciate what I can see in Phoenix and other libraries like Absinthe etc.
However, I recently had a simple problem using this macro,
All I needed was to share it amongst tests. The tests would sometimes work with it in a shared library function file, sometimes not. Frustrating.
In the end I switched to the function,
and everything was good.
When I have a function-first API I can do well defined things. When I have macros things often seem harder to compose together, and scale.
I am making extensive use of Absinthe, and suspect with a little more time, thought and fewer macros I could more efficiently abstract my schema & type code also…
Certainly macros have their place, but they seem to chose a level of abstraction a priori, which doesn’t fit well always (especially with larger projects).