News for hackers. Stuff that matters.
Re:List Processing in C by arethuza on Tuesday December 21, 2010 @07:49AM (#2027607)
I don't think macros are inherently evil - but they certainly facilitate Lovecraftian horrors. I have seen production embedded code where the authors didn't really like C and decided that vaguely Pascal like syntax would be better and did this through macros - probably vaguely influenced by the original Bourne shell sources but with a darker madder twist.
Re:List Processing in C by sdevlin on Tuesday December 21, 2010 @09:55AM (#2027965)
It seems like you could say that about any sufficiently powerful construct. Sharper knives require better judgment to be used safely.

This is why we often give novices rules of thumb like "don't use macros" or "don't use goto." I've seen some people criticize this practice, but I think it's actually a good thing; when you're just starting out, you don't know when these things are really called for. Working under some constraints simplifies things.

With experience, you learn the pain points well enough to outgrow those rules and use macros/goto/whatever when called for.