Snafucated Code  Snafucated Code

go to home page feedback about the unmaintainable code essay full screen, hide local find menu Google search web for more information on this topic jump to foot of page translate this page with Babelfish ©2000-2009 Roedy Green, Canadian Mind Products

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
CMP logofeedback Please email your feedback for publication, errors, omissions, typos, formatting errors, ambiguities, unclear wording, broken/redirected link reports, suggestions to improve this page or comments to Roedy Green : feedback email
mindprod.com IP:[65.110.21.43]
viewYour face IP:[38.107.191.100]
You are visitor number 11.