We programmers are nice folks. Instead of calling things “error that I made” we’ve found this nice little word “bug” to represent our mistakes. It’s hard to admit making a mistake or an error (especially when it’s “Windows error, not my bug”), but admitting making a bug is bit more likely (at least for those who stop saying “it’s not a bug, it’s a feature”)
Anyway. Here’s some of my favorite ways of creating bugs in games:
- Don’t use functions (or objects and classes, or anything that sounds “too big for my current small challenge right now”)
- Use tons of IFs.
- Copy & paste code.
- Use principle of adding “special cases just to deal this situation” to your code.
- Edit the wrong files.
- Add tons of changes and then test all them once (instead of testing each new update after the change is done).
- Try coding 3 to 7 different issues simultaneously (instead of one)
- Change some parts of code for testing “just for a while” and then don’t document why you did this.
- Forget testing in Release mode, Debug mode will be enough. (Not exactly helping to create a bug, but will help spotting some)
- Leave parts of code open (and of course undocumented) and take a 2 week break
- Start something big just before you are about to end for the day (and you will find yourself spending the next morning figuring out what was going on)
- Use some of your previously created code in your current game (and notice how many bugs there lies)
- Use the shortest possible variable names (“c, cc, i, h, hiryb” instead of count, creditCard, i, height, heIsRockingYourBoat). Always.
You agree, disagree? How about adding your favorite ways for creating bugs?