3 ms·
C is extremely simple. In fact is one of the few languages that you could manage to understand completely in the sense of knowing exactly what it does. C macro
by hevi_jos 8y ago
C is extremely simple. In fact is one of the few languages that you could manage to understand completely in the sense of knowing exactly what it does.
C macros on the other hand, should die. I use C a lot but never ever use c macros, they are evil. Extremely hard to debug, confusing and very weak.
When we want macros, we use Lisp, that have proper macros.
- bitt 8y agoI'm not sure of all the valid use cases for macros, but I think they are useful when you need to do something simple. For example, a debug flag to run some code like verbose logging but you don't want to include that in the release binary. C# has preprocessor directives but I wish that java had something similar. I guess this is different than complex micros though.