Macros in Programming Languages
The cluster discusses the use, advantages, disadvantages, and necessity of macros in languages like C, C++, Rust, and Elixir, debating their role in handling boilerplate, code generation, hygiene, and as alternatives to other language features.
Activity Over Time
Top Contributors
Keywords
Sample Comments
Seems like most languages where you'd use this already have macros?
Macro is one of the ugliest features available in langs like C/CPP
Macros don't appear in your code example, so they cannot solve anything.
Macros are inscrutable garbage and a sorry hack.
using macros to deal with boilerplate, although useful, though is of a different order than things that simply cannot be expressed without macros
Most languages don’t have macros powerful enough to do this.
Aren't macros a just form of code generation?
you can do that using macros in langs such as c, cpp or elixir
As if macros weren't their own kind of magic.
Macros still can cause a lot of problems. See some of the crazy C++ macros or Template Haskell.