How to write Unmaintainable Code
25 actionable tips to write code as unmaintainable as possible
In this tutorial I want to illustrate how to write unmaintainable code.
By writing unmaintainable code you can make sure you will never get fired because you’ll be the only one capable of understanding what the code does, and most importantly why.
Please note: this post is ironic
- Assign weird, fantasy and casual names to your variables, functions and objects. There should be no correlation between the name and what the item does or how it behaves.
- Prefer abbreviations and acronyms over descriptive names. One-letter variables are great.
- Favor reuse of variables in the code. Always use
iin your loops.
- Use your own language for names. After all, there’s no need to all use English.
- Same applies to comments. Feel free to write them in whatever language you speak, who cares if the next developer is from another country?
- As for comments, I was joking. Do not write any comments.
- If you really want to write comments, do not bother to update them when you change the code that they describe.
- Prefer global variables over getting too clever with scoping
- Never test your code. You are good, your code is good too.
- Prefer overcomplicating than being too simplistic. No one was ever fired for creating a complex and ego-fulfilling architecture that required a 3-months long useless rewrite of code that was perfectly working.
- Optimize whatever you can in clever ways. Computers are slow, we should avoid overheating them and help fight climate change. Rewrite your code in assembly is often a good idea.
- Relatively unknown languages and frameworks are always better than popular and battle tested solutions. Prefer them over the solution everyone else uses.
- Better yet, create your own framework.
- Never use 3rd party libraries
- Overuse 3rd party libraries
- Use every design pattern you read about, and try to fit it into your design even if it’s not, really
- Use tools built by large corporations because they know it better and your 1-person startup will surely benefit from the thousands of man hours that went into building them. Bonus points if they are very complicated to use and have their own set of clever-sounding naming conventions.
- Do not use version control, and do not even version the code at all. After all there’s just one right version of the program. You can easily remember all the changes you perform and most importantly why a change was made. No need to track it in an external repository.
- Freely copy and paste code from Stack Overflow or random blogs without understanding it first
- Indentation does not matter. At all. Mix spaces and tabs, too.
- Freely overuse abstractions. Abstractions are great. Make everything reusable and overthink things like a king.
- Perhaps you’ll reuse this library in every project you’ll make in the next 20 years, who knows? Better think about all the possible edge cases first.
- Always implement every single great idea you have
- 2000-lines functions are a great idea
- Assume there’s a 10x engineer watching over your shoulders while you code.
THE VALLEY OF CODE
THE WEB DEVELOPER's MANUAL
You might be interested in those things I do:
- Learn to code in THE VALLEY OF CODE, your your web development manual
- Find a ton of Web Development projects to learn modern tech stacks in practice in THE VALLEY OF CODE PRO
- I wrote 16 books for beginner software developers, DOWNLOAD THEM NOW
- Every year I organize a hands-on cohort course coding BOOTCAMP to teach you how to build a complex, modern Web Application in practice (next edition February-March-April-May 2024)
- Learn how to start a solopreneur business on the Internet with SOLO LAB (next edition in 2024)
- Find me on X