3 ms·
Why would you shy away from macros? Yes they are ugly, but they are an integral part of C and any system programming will rely quite heavily on macros, whether
by misham 16y ago
Why would you shy away from macros? Yes they are ugly, but they are an integral part of C and any system programming will rely quite heavily on macros, whether we like it or not.
If you're going to cover macros, please make sure to explain how they work and the multitude of pitfalls as well as how to deal with them; which is to wrap each macro in parenthesis.
- alnayyir 16y agoThere are as many potential problems with macros as there are grains of sand in Saudi Arabia. Best not to go there beyond explaining how and why not to, and leave it at that. Order of operations is an example of something that bites people with macros. (ref/deref + macro has nailed a lot of professionals I know)