here's an article about how to write unreadable code i found some time ago.
The best part about writing code impossible to understand comes from your ability (well, it's more like a form of art) of finding crazy names for your variables, functions and methods.
Those names don't mean anything to the computer so you have the opportunity to use any possible technique to make the programmer feel stupid.
1. Use the Book of Names (ISBN-13: 978-0684039992)
Buy one right now and you'll never have to worry about finding a name for your variables.
"Cathie" is a great name, it's short, you can write it fast and gives you a bunch of other options (Cathy, Kathi, Kathie, Kate, Katee...) all similar and easy to mistake for each other.
If you are looking for easy "names" use "adsf" or "aeou"
2. Grammatical errors
If you are going to use descriptive names for your variables and functions forget about grammars and how to spell words.
3. Abstraction
Use heavy abstraction ("how" "that" "data" "manage" "do") and numbers:
how32, that19, data927
4. A.C.R.O.N.Y.M.S
use acronyms to clean your code. Always remember that real men never, NEVER, explain an acronym: they understand thanks to their genes.
5. Synonyms and Contraries
Avoid monotony and use a nice vocabulary. If you have a bunch of functions and variables whose meaning is the same using synonyms you'll imply that there is a difference between each other, but if you have functions that have some crucial difference between each other make sure to use always the same name.
ie: use "print" for a function that print a document with a printer, for one that writes on a file and for one that print some text on screen.
6. Use foreign languages.
"this script keep trace of the many statil returned by vaxen".
Esperanto, Klingon, Sindarin all qualify for this purpose
7. uPpeR caSE
Use upper case letters to identify single words into a long string, but do it randomly
8. Reuse names
Make sure to use the same variable for at least 3 different purpose and in multiple scopes in the same script.
You have to make sure that is someone search for that variable as many result as possible will be returned.
9. Accented (stressed) letters
use accents for variables names.
ie:
typedef struct {int i;} ìnt;
if you didn't notice the "i" of the last "int" is accented.
10. Take advantage of variables max length.
if your compiler supports just 8 character always use longer names, just changing the last part of it.
ie:
var_unit_dimension and var_unit_expression look different, but for your compiler they are the same thing.
11. Underscore is your friend
use both _ and __ as identifiers
12. Mix languages
Use as many languages as possible in your comments.
Who read it cannot say that you didn't comment but may be wondering why some of them are in german while others are in Thai.
13. ASCII code is made of 255 characters
and almost all of them can be used for variable names (§, ¿).
14. Use common names for variables
Choose the most common names for your variables, but make sure they are not related to what those variables are for:
marypoppins = (julieAndrews + starship) / mailbox;
In this way whoever read it will have an hard time trying to disconnect that name from it's usual context.
15. Typical variables
Never use "i" in a loop, use any varible but "i"
16. Ignore implicit conventions
If your language (ie Java) has some implicit conventions for name (classes start with upper case letters while variables don't) ignore them!
Make up your own conventions and rant about no one else using them.
17. 'l' (L) looks similar to '1' (one)
Two names like def1ab and deflab are similar but different.
18. Be creative with your function's arguments.
If you have a function named F that makes a call to function G passing an argument that inside F is named A, in G use a different name that's present inside F but not in G.
This will make much harder to understand what exactly G is doing and how is used it's returned value.
ie:
if you have a function CalcWidth(height, size), use height to contain the value that will be used as size into the elaboration.
19. Usng abbrvtn (Using abbreviations)
There's not just one way to abbreviate a word: be creative.
20. Under-estimate functions
Use for your functions names that won't give a precise idea of what the function exactly does.
If someone makes questions just tell them that the function got improved across time and you didn't change the name.
ie:
isValid( x )
should validate X but also converts it in binary and save it inside the database.
21. Hungarian Notation
Hungarian notation is the perfect weapon in the hands of the evil programmer.
If you don't know what hungarian notation is, it's the practice of prepending to the name of the variable a prefix that identify what that variable is for.
ie:
intValue, strText, objObject and so on.
all you have to do is use identical prefix with different meanings across the code.
ie:
intXXX = Integer not trusted...
intXXX = index number of transactions
intXXX = information not translated...
strXXX = status to remember...
22. Hungarian Notation part 2
Follow Microsoft example: the variable type changes but the name doesn't.
22. Recycle
If you defined a structure to contain data from a callback, define the structure in every single module of the program assigning to it always the same name.
That will drive crazy the debugger (especially the VC++ one), so when you'll request the content of a structure in the observation window the debugger will
have no idea about which one to show and will pick up a random one.
23. Use names that look similar to instructions
Null, cOnst, For and stuff like that.
24. Use names that don't have anything to do with whatever you are showing on screen.
Who said that a field named "Name" on screen must correspond to a variable named "Name"?
25. Be creative with your constants
who said you can't have a constant named FALSE contianing a boolean true value?