A brilliant essay located here:
It's very funny. A sample:
#3 Creative Miss-spelling
: If you must use descriptive variable and function names, misspell them. By misspelling in some function and variable names, and spelling it correctly in others (such as SetPintleOpening SetPintalClosing) we effectively negate the use of grep or IDE search techniques. It works amazingly well. Add an international flavor by spelling tory or tori in different theatres/theaters.
#13 Underscore, a Friend Indeed
Use _ and __ as identifiers.
#18 Bedazzling Names
Choose variable names with irrelevant emotional connotation. e.g.:
marypoppins = ( superman + starship ) / god;
This confuses the reader because they have difficulty disassociating the emotional connotations of the words from the logic they're trying to think about.
# 34 Fun With Colours
It goes without saying you should use numeric colour literals rather than named constants. Unfortunately, most skilled maintenance engineers will have learnt by now that hex coded colour values are easy to decode. E.g. 0x0204FB is
Red = 02
Green = 04
Blue = FB
Which is clearly pretty much entirely blue.
You want is to use the decimal value, 132347. There's no way without the aid of paper or a calculator that any normal person could convert that into the colour 'blue'. For extra bonus points you can produce a decimal colour that looks like it's expressed as hex, for example 808000. A quick glance would guess half red + half green = darkish yellow, but in fact it's not hex, the real colour is 0xc5440 (a dark cyan).
The Netscape colours are all carefully named. For example papayawhip is 0xffefd5. Just to keep them on their toes, define a papayawhip colour constant as 0xff00ff, a garish magenta. Have fun making up obscure colour names like algae = 0x556b2f instead of darkolivegreen. Very few people know what colour puce and teal are, but would never admit it. Exploit that.
You can even lay a trap for a programmer who comes after you to do the dirty deed. Use accurately-named but hideous colours. If the follow-up programer is lazy, he will change the colour definitions to something sane, but will leave your original colour names.
Don't Recompile
: Let's start off with probably the most fiendish technique ever devised: Compile the code to an executable. If it works, then just make one or two small little changes in the source code…in each module. But don't bother recompiling these. You can do that later when you have more time, and when there's time for debugging. When the hapless maintenance programmer years later makes a change and the code no longer works, she will erroneously assume it must be something she recently changed. You will send her off on a wild goose chase that will keep her busy for weeks.
Foolish Consistency Is the Hobgoblin of Little Minds
When you need a character constant, use many different formats: ' ', 32, 0x20, 040. Make liberal use of the fact that 10 and 010 are not the same number in C or Java.
There's tons of it, read it all.
It's very funny. A sample:
#3 Creative Miss-spelling
: If you must use descriptive variable and function names, misspell them. By misspelling in some function and variable names, and spelling it correctly in others (such as SetPintleOpening SetPintalClosing) we effectively negate the use of grep or IDE search techniques. It works amazingly well. Add an international flavor by spelling tory or tori in different theatres/theaters.
#13 Underscore, a Friend Indeed
Use _ and __ as identifiers.
#18 Bedazzling Names
Choose variable names with irrelevant emotional connotation. e.g.:
marypoppins = ( superman + starship ) / god;
This confuses the reader because they have difficulty disassociating the emotional connotations of the words from the logic they're trying to think about.
# 34 Fun With Colours
It goes without saying you should use numeric colour literals rather than named constants. Unfortunately, most skilled maintenance engineers will have learnt by now that hex coded colour values are easy to decode. E.g. 0x0204FB is
Red = 02
Green = 04
Blue = FB
Which is clearly pretty much entirely blue.
You want is to use the decimal value, 132347. There's no way without the aid of paper or a calculator that any normal person could convert that into the colour 'blue'. For extra bonus points you can produce a decimal colour that looks like it's expressed as hex, for example 808000. A quick glance would guess half red + half green = darkish yellow, but in fact it's not hex, the real colour is 0xc5440 (a dark cyan).
The Netscape colours are all carefully named. For example papayawhip is 0xffefd5. Just to keep them on their toes, define a papayawhip colour constant as 0xff00ff, a garish magenta. Have fun making up obscure colour names like algae = 0x556b2f instead of darkolivegreen. Very few people know what colour puce and teal are, but would never admit it. Exploit that.
You can even lay a trap for a programmer who comes after you to do the dirty deed. Use accurately-named but hideous colours. If the follow-up programer is lazy, he will change the colour definitions to something sane, but will leave your original colour names.
Don't Recompile
: Let's start off with probably the most fiendish technique ever devised: Compile the code to an executable. If it works, then just make one or two small little changes in the source code…in each module. But don't bother recompiling these. You can do that later when you have more time, and when there's time for debugging. When the hapless maintenance programmer years later makes a change and the code no longer works, she will erroneously assume it must be something she recently changed. You will send her off on a wild goose chase that will keep her busy for weeks.
Foolish Consistency Is the Hobgoblin of Little Minds
When you need a character constant, use many different formats: ' ', 32, 0x20, 040. Make liberal use of the fact that 10 and 010 are not the same number in C or Java.
There's tons of it, read it all.
Comment