Click here to Skip to main content
14,088,208 members
Click here to Skip to main content
Add your own
alternative version

Tagged as


55 bookmarked
Posted 1 Feb 2010
Licenced CPOL

An Idiots Guide to Really Really Bad Programming

, 1 Feb 2010
Rate this:
Please Sign up or sign in to vote.
A satirical look at bad programming techniques


I have noticed that certain individuals persist in writing good clear code that is well documented and easy to understand. So I thought it was about time to draw the main techniques of really really bad programming together into a single reference document. Remember the most important two things when writing truly awful software are to include as many subtle bugs as possible and to make the code really confusing so that it is hard to track those devious little bugs down. That way you can annoy both users and programmers to the maximum extent.

If you follow these simple rules, I promise you that you will never be far from users’ and other programmers’ thoughts.

1. Turn Off All Compiler Warnings

If you want to write really awful code, this is a great place to start. After all, you do not want that pesky compiler nagging you all day. All real programmers turn the warnings off completely.

2. Variables

Beginners should ensure that all variables are global. It is much easier to keep them all together in one place. As you become more advanced, add local variables with the same names as the globals, this will allow you to create subtle bugs with ease.

3. Functions

Avoid using functions wherever possible. It is much easier to write one single enormous long passage of code than going through the tiresome process of trying to divide it into separate functions and having the tedious job of passing parameters to them.

4. Cut and Paste is your Friend

Avoid using loops at all costs, it might take longer to cut and paste a section of code over and over, but it is well worth it when you consider the hours of fun for anyone checking each and every repeat of that code for subtle variations.

5. Variable Names for Beginners

You can have so much fun with variable names, try using the most meaningless name that you can think of, Fred is one of my personal favourites. But always include a smattering of semi meaningful names to keep other programmers guessing.

6. Advanced Variable Name Techniques

Ideally try to think of names that are very similar for as many entirely different variables as you can. Another great idea is to create two variables with the same name, but one ending in ‘1’ and the other in ‘l’, these are very easy to confuse at a glance and should get other programmers really guessing. Example: Slopel and Slope1. However, you can achieve the best results by occasionally using a label to mean the exact opposite of what people would assume, a classic example is to use the label Horizontal to mean Vertical and vice versa, that will really please any reader of your code, causing hours of amusement and pleasure as they try to unravel it.

7. Initialising

Play programmers bingo by allowing all of your variables to start with whatever value the memory had in from the last application. Great fun!

8. Bounds Checking

Allow the user to enter whatever values they want, if they enter a stupid value the program may crash. So? What do they expect?


It is best for beginners to avoid comments at all times, they waste valuable space and take ages to type. As you become more advanced, you can begin by adding comments which are entirely useless, because they state the obvious such as:

i++; // increment i

However, the most advanced comments will be as cryptic as possible, such as:

i++; 	//check inside the chicken string

10. Layout

It takes real dedication to make your software layout truly bad. The most important thing is NEVER EVER be consistent. Whatever layout philosophy you choose, be sure to change it regularly. Advanced programmers should remember to use the same layout for long enough for any other programmer to become accustomed to it before changing to something entirely different.

11. Hungarian Notation

This is entirely optional, but for best results use a smattering of Hungarian Notation, thus annoying everyone (those who like it AND those who don't) and of course include a few incorrect uses just to make things more interesting.

12. Lastly Never Ever Test

Don't bother to test your code, just wait for people to complain, that way you will find out which are the most commonly occurring bugs first! Brilliant!

I have tried to cover most aspects of Really Really Bad Programming, but I am sure many of you can think of a few more. And don't be down hearted if after a while you start to slip into good habits, it doesn't take much effort to get back to those bad bad ways.


I am not in any way suggesting that I never write bad code, nor am I suggesting that anyone else at CodeProject does. Just having a little fun!


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

United Kingdom United Kingdom
No Biography provided

You may also be interested in...

Comments and Discussions

QuestionLaughing out loud Pin
WajihaAhmed25-Dec-12 5:00
memberWajihaAhmed25-Dec-12 5:00 
AnswerRe: Laughing out loud Pin
LittleYellowBird10-Jan-13 0:51
memberLittleYellowBird10-Jan-13 0:51 
QuestionNice Pin
BillW338-Jun-12 11:08
professionalBillW338-Jun-12 11:08 
AnswerRe: Nice Pin
LittleYellowBird10-Jan-13 0:50
memberLittleYellowBird10-Jan-13 0:50 
GeneralMy vote of 5 Pin
Tarek Elqusi17-May-12 6:08
professionalTarek Elqusi17-May-12 6:08 
GeneralRe: My vote of 5 Pin
LittleYellowBird10-Oct-12 3:16
memberLittleYellowBird10-Oct-12 3:16 
GeneralMy vote of 5 Pin
Leonardo Paneque15-Apr-12 13:09
memberLeonardo Paneque15-Apr-12 13:09 
GeneralRe: My vote of 5 Pin
LittleYellowBird10-Oct-12 3:16
memberLittleYellowBird10-Oct-12 3:16 
GeneralMy vote of 5 Pin
RC_Sebastien_C20-Jan-12 10:20
memberRC_Sebastien_C20-Jan-12 10:20 
GeneralMy vote of 5 Pin
Pranit Kothari30-Dec-11 1:54
memberPranit Kothari30-Dec-11 1:54 
GeneralMy vote of 5 Pin
S Houghtelin30-Jun-11 3:59
professionalS Houghtelin30-Jun-11 3:59 
GeneralRe: My vote of 5 Pin
LittleYellowBird31-Oct-11 6:38
memberLittleYellowBird31-Oct-11 6:38 
GeneralMy vote of 5 Pin
Sander Rossel30-Apr-11 5:57
professionalSander Rossel30-Apr-11 5:57 
GeneralRe: My vote of 5 Pin
LittleYellowBird30-Apr-11 10:53
memberLittleYellowBird30-Apr-11 10:53 
GeneralThats me in a nutshell Pin
asg196625-Apr-11 8:32
memberasg196625-Apr-11 8:32 
Hi Alison, my heart sank as I read through these as I realised that I am a bad programmer. Maybe not really really bad but bad none the less. I need to find another job! Andrew.
GeneralRe: Thats me in a nutshell Pin
LittleYellowBird25-Apr-11 21:40
memberLittleYellowBird25-Apr-11 21:40 
GeneralRe: Thats me in a nutshell [modified] Pin
asg19662-May-11 3:57
memberasg19662-May-11 3:57 
GeneralRe: Thats me in a nutshell Pin
LittleYellowBird13-May-11 19:12
memberLittleYellowBird13-May-11 19:12 
GeneralRe: Thats me in a nutshell Pin
asg196614-May-11 2:43
memberasg196614-May-11 2:43 
GeneralRe: Thats me in a nutshell Pin
LittleYellowBird15-May-11 22:07
memberLittleYellowBird15-May-11 22:07 
GeneralMy vote of 5 Pin
David C# Hobbyist.27-Feb-11 12:42
professionalDavid C# Hobbyist.27-Feb-11 12:42 
GeneralRe: My vote of 5 Pin
LittleYellowBird30-Apr-11 10:54
memberLittleYellowBird30-Apr-11 10:54 
GeneralMy vote of 5 Pin
hoernchenmeister22-Feb-11 4:05
memberhoernchenmeister22-Feb-11 4:05 
GeneralRe: My vote of 5 Pin
LittleYellowBird30-Apr-11 10:56
memberLittleYellowBird30-Apr-11 10:56 
GeneralMore variables rules Pin
Xmen Real 16-Feb-11 15:31
professional Xmen Real 16-Feb-11 15:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web01 | 2.8.190518.1 | Last Updated 1 Feb 2010
Article Copyright 2010 by LittleYellowBird
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid