I was referring to the macro preprocessor. C is a great language (although it is primitive by modern standards). The preprocessor is a separate and distinct language, not so good.
I have seen endless incomprehensible preprocessor crap. People have even used it for metaprogramming.
I used to use it for metaprogramming, too. One day, I decided to rip it all out and use the preprocessor as little as possible. The result was much better.
Analogous to C are the macro processors for assemblers. A friend of mine who worked at Microsoft told me about an assembler program that was about 50k. The person who wrote it had left the company. There was a bug in the program, and the manager assigned it to programmer after programmer, and they'd all give up on it after a couple weeks. So my friend said he'd fix it, and fixed it in a couple hours and checked it in.
The manager was surprised. He asked how my friend managed it. My friend said that the code was all macros to create a magical special undocumented half-assed language that nobody could understand. So he ran the object file through a disassembler (mine) to generate source code. Then the bug was obvious, he fixed it, and checked in the disassembly as the new source.
I've also heard complaints from Scala programmers about the overuse of macros making for incomprehensible code.
I have seen endless incomprehensible preprocessor crap. People have even used it for metaprogramming.
I used to use it for metaprogramming, too. One day, I decided to rip it all out and use the preprocessor as little as possible. The result was much better.
Analogous to C are the macro processors for assemblers. A friend of mine who worked at Microsoft told me about an assembler program that was about 50k. The person who wrote it had left the company. There was a bug in the program, and the manager assigned it to programmer after programmer, and they'd all give up on it after a couple weeks. So my friend said he'd fix it, and fixed it in a couple hours and checked it in.
The manager was surprised. He asked how my friend managed it. My friend said that the code was all macros to create a magical special undocumented half-assed language that nobody could understand. So he ran the object file through a disassembler (mine) to generate source code. Then the bug was obvious, he fixed it, and checked in the disassembly as the new source.
I've also heard complaints from Scala programmers about the overuse of macros making for incomprehensible code.