| The link seems a bit old, modern day development has added many new and exciting methods for making unmaintenable code: - Use exceptions for control flow. With different exceptions leading to entirely different flows. On C you can use setjmp/longjmp + globals for a similar effect. This will help the maintenance programmer develop thinking in multiple dimensions. - To save space, do not declare separate constants for every magic number/string. Instead use one large constant pooling all the constants, and then deduce the other constants from parts of the one large constant. You'll be teaching the maintenance programmer an advanced optimization technique. - Abuse localization rules whenever a case-insensitive operation is operated (e.g. Turkish i, German eszett, etc.). You'll be broadening the mind of the maintenance programmer, teaching cultural differences. For extra points, when dealing with fixed string constants in the code, abuse Unicode's right-to-left rules to make the shown data rather different than the actual data the compiler sees, and zero width characters the make the shown length different than the actual length. This is particular useful with the "one large constant technique" from above. - Do use locals when the locals shadow the global variable. This will teach the maintenance programmer to pay attention. - Supply more precise overrides in files/projects included in partial compilation as to make code that will behave differently depending on compilation order, included files/projects, etc. This will help teach the importance of a build system. Bonus points if the included code is actually similar, but relies on subtle differences in the behaviour of a previous version of the framework or included packages. |
Exceptions? Pfsh... that's so early 2000s.
If you really want to mess with a dev these... make everything async and don't bother to check if it completes.
And don't forget the flip side... the ui thread shouldn't be responding to messages when it could be blocking on a long running process!