Snafucated Code  Snafucated Code

Here is an email I received in response to my essay on how to write unmaintainable code.

Snafucated Code : Frank Klemm : pfk@fuchs.offl.uni-jena.de : 2000-09-10

Another examples:

struct/union and typedef struct/union are different name spaces in C (not in C++). Use the same name in both name spaces for structures or unions. Make them, if possible, nearly compatible.

use deep looped conditional compilations. Never handle system specific code in libraries, use #if/elif/else/endif orgies, if possible, deep loop them.

Make functions as long as possible to increase performance. Don’t use functions if the function code can be optimized in place.

Give function variables a slighly wrong name. So name a variable containing the number of channels (1 or 2) the name stereo. Test for mono with with stereo == 1, for stereo with stereo != 1 so no one begins to wonder about the real meaning of this variable. Use if (stereo) { stat; } for a simple { stat; } because stereo is always true.

Cross include include files as much as possible. Make circular dependencies between the include files. Hide the problem by using void* to structures and use typecasts to access this structure.


CMP homejump to top You can get the freshest copy of this page from: or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror)
http://mindprod.com/feedback/unmain/snafucated.html J:\mindprod\feedback\unmain\snafucated.html
logo
Please email your , letters to the editor, errors, omissions, typos, formatting errors, ambiguities, unclear wording, broken/redirected link reports, suggestions to improve this page or comments to Roedy Green : feedback email. If you want your message, your name or email kept confidential, not considered for public posting, please explicitly specify that. Unless you state otherwise, I will treat your message as a letter to the editor that I may or may not publish in the feedback section. After that, it will be too late to retract it. If you disagree with something I said, please quote it and cite the web page where you found it, tell me why you think it is wrong, and, if possible, provide some supporting evidence. Threatening to kill me or spouting obscenities has yet to persuade me to change my mind.
mindprod.com IP:[65.110.21.43]
viewYour face IP:[38.107.179.214]
You are visitor number 11.