3 ms·
Right, you can "hide" what's going on in otherwise proceedural C codebases w/ the preprocessor. To be more charitable to OP, in C++ you can further "hide" what
by ndesaulniers 4y ago
Right, you can "hide" what's going on in otherwise proceedural C codebases w/ the preprocessor.
To be more charitable to OP, in C++ you can further "hide" what's going on with destructors in addition to the preprocessor.
(I like RAII and hope more C programmers can learn to appreciate it. I have fixed and reviewed many fixes in the Linux kernel for -Wsometime-initialized because error handling using goto is a constant source of programmer mistakes introducing UB).
I'd love to chat sometime about approaches to implementing a CPP!
- int_19h 4y agoIt's not even that macros can hide complexity. It's that the specification for the C preprocessor is itself rather complicated and non-obvious - e.g. what happens when nesting even simple macros, or even something as basic as tokenization.
- WalterBright 4y agoRight, I was talking about the specification, not the use. How people use the preprocessor is by just fiddling with it till it delivers what they want, then they move on.