I came across Roedy Green’s satire, via JP, on writing code to ensure a job for life. Though focused on Java, you can apply the tips quite efficiently for any programming language, and make it equally unmaintainable. Roedy has brought out the evil in a humorous way, a good read. If you end up taking this seriously, consider it to be a manual on what not to do. Sometimes that is the easier route to understanding what to do.