|
|
|
|
|
by loup-vaillant
5351 days ago
|
|
Could you give your estimate of the properly used/badly used ration of copy/paste, preprocessor macros, and goto? Mine would be "too low for me to worry about". Okay, there are some (corner) cases where they really are a good idea. But "never ever use this Chtulu Abomination" still is a damn good heuristic. |
|
Preprocessor macros: Code generators, compile-time switchable code (such as logging) without filling your source files with #ifdefs
Goto: Managing complex resource allocation/deallocation within a function:
I disagree that dismissing a tool out of hand as an "abomination" is a commendable approach. If you take that attitude (or instill it in others), you'll probably never learn the proper use of such a specialized tool, leaving you ill-equipped to deal with the situations those tools handle well.