Code cleanup is a problem
So far, I have done 0 lines of code for Pyggy. The "release" I have at my files is just something I've added for myself so I could have a more challenging level to play while I waited for the results. Wanna know the reason why I haven't done anything? The culprit here is code cleanup.
Are you doing a game? If your personality type is anything like mine, you should better be doing it right the first time. Programming is fun, learning from your mistakes is good and rewarding, looking at a horrible pile of crap that you have coded yourself and thinking about putting it in order? *YAWN*
Whenever possible you should do things right. There are very rare exceptions to that, and I'm going to list them down with as many restricitons as possible, because I really want to discourage people from trying out "quick and dirty" approaches to things.
When is it okay not to "do things right":
- You are in an algorithms competition. The programming phase of the competition is ending, you're unsure of what you're doing and submitting programs that do something wrong will not cause your score to be punished in any way. Under such circumstances you're probably not going to get the problem solved, but you might, which is better than the 0% chance of getting it right if you give up.
- You're trying to learn some new algorithms. Under such circumstances, it is kinda natural that you'll mess things up a bit in the way. Play a little with the algorithm while you do not understand it very well, but make a good, correct and well-tested implementation of it as soon as you're capable.
- You're learning a new programming language or library and you have no clue of what constitutes "doing it right". This is similar to the case above, play around a bit. Do not build a big project while you don't understand well what you're using. Instead, write small projects, enter mailing lists, ask questions, ask about programming standards, talk on IRC channels. Whenever there seems to be disagreements on what constitutes good practice you think carefully. Keep a a copy of the Zen of Python whenever you feel conflicted.
- You're intentionally trying to write bad code. Under such circumstances you should pray you're not my co-worker.
The main reason for that is that you don't want to build upon bad code. Things built over bad code very hardly become good. Things are going to be clunky, behave in ways you did not expect or simply not work at all.
Working with improper code disrupts your job in several ways. If you're adding features to a game in the last minute you risk breaking what could have been a perfectly functional game. If the design is stupid, the things you build over will have a higher likelyhood to be stupid too. Worse, they might depend on stupid design.
You do not want to build code that depends on something else in your program being stupid, because when you decide to "do things right", you'll see that fixing one thing breaks everything else.
So, there. I'll probably just scrap entirely most of what I've written for the game and start clean. I don't want to make fixes to what I've done, because if I do so there's going to be a huge overhead of making what I intend to be good code comform to the stupid code I wrote for the compo.
"Doing things right" takes a bit of practice, but it is in no way a time consumer, but a time saver. Think before you code.