News for hackers. Stuff that matters.
Re:Metaprogramming custom control structures in C by fancydriving on Monday March 12, 2012 @10:46PM (#3696760)
I think a good rule of thumb is to only use the preprocessor to generate code that you would be comfortable writing yourself. Spaghetti produced by macros is still spaghetti.

The article reminded me of queue.h from BSD (http://www.openbsd.org/cgi-bin/cvsweb/src/sys/sys/queue.h?re...), but those macros expand to readable code.

Re:Metaprogramming custom control structures in C by ay on Tuesday March 13, 2012 @07:26AM (#3697908)
These macros are nothing compared to what I consider a real abuse of the preprocessor - a whole functional language implemented just by that! Search for "chaos-pp" in this entry (which has plenty of other wonders too!):

http://stackoverflow.com/questions/652788/what-is-the-worst-...