30 ms·
I have not seen a single Elixir project that doesn't have a spaghetti mess made out of macros. You can rant all you want about the disadvantages of OOP and oth
by 29athrowaway 1y ago
I have not seen a single Elixir project that doesn't have a spaghetti mess made out of macros.
You can rant all you want about the disadvantages of OOP and other paradigms. But after your rant, do not come up with an even more absurd type system that gives you even more work to do without any upside.
Building a project out of constructs such as macros does not scale with project size or team size. The only aspect that scales is the resulting size of the unmanageable spaghetti. Tolerating having that as a widely used feature in your language and then praise it as being fantastic truly makes one wonder what are you comparing the Elixir experience with? Elixir is fantastic compared to... fighting 100 gorillas blindfolded.
There are good choices built into the language, like railroad oriented programming. But those will never undo the infinitely awful and inadequate insanity of having to deal with macros to survive.
And to be frank, even if there are use-cases where the language shines and can be excellent tool for the job, most of the time those are not your use-case, and most of the time your team is not familiar with the language enough to leverage its advantages or build something production-worthy.
And if you ever go through the pain of mastering Elixir, 99.99% of the time your next job will not use it. If you are at a startup celebrating the virtues of Elixir before having enough revenue, your next non-Elixir job is closer than you think because your company will run out of money. And if your plan is having a LLM help you write Elixir faster before you burn through your budget? Good luck debugging a labyrinth made out of AI generated macros, your on-call rotation will go great. Your stakeholders will be eager to learn more about how great Elixir is when they ask for an explanation of why nothing works, an estimate of when it will be fixed, why is the project late or how can they add more team members to make it go faster.
- victorbjorklund 1y agoI almost never use macros (unless you count that Elixir itself is built with macros or that Phoenix uses macros. But they are well-written and documented. Problem with macro more comes when you got your own DSL that no one knows).
- conradfr 1y agoI have almost never written macros in my elixir projects. Because I have a hard time even understanding them :) I think they are mostly useful if you write libraries.