The Hazards of Macros
What I really wanted was a clean, safe, readable syntax for declaring, defining, and using classes in Standard C. I achieved this by using C preprocessor macros to "automagically" generate and intialize structures like those described in the section "Implementing Classes in C." Using macros to provide new syntax is frowned on by many experts, and for good reasons. For one, the C preprocessor is quite primitive, and macros which are easy to use can be amazingly difficult to read and understand. Indeed, my teammates often rib me about "the macros from hell." Another disadvantage is that brain dead tools will not expand macros during source debugging. But the most compelling argument is that once you extend the C syntax, you are no longer programming in C. Instead you are programming in the new language defined by your macros. So be sure that you really need to extend C. If you do, then you are facing a language design task as much as a programming task, so carefully consider the features you really need, and carefully lay out the syntax of your new language.