Here is an email I received in response to my essay on how to write unmaintainable code.
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.
| 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 | |
![]() | ||
| Canadian Mind Products | ||
| mindprod.com IP:[65.110.21.43] | ||
| view | Your face IP:[38.107.191.100] | |
| Feedback | You are visitor number 11. | |