Please note that I don't update this web site anymore. You can visit my new personal blog at www.williamwilling.com.
Le mieux est l'ennemi du bien
Monday, January 17, 2005
The comments to my recent entry were very clear in pointing out that the problems I'm experiencing with Trichromix are not due to a programming language or a text editor; the problem is with the way I tend to approach programming. Writing perfect code that follows all the rules of 'proper OOP' and 'correct C++' might be a nice way to fill your spare time, but it is not the way to go if you ever want to finish your product.
I considered my next step. The technical problem I was facing at that moment had to do with the interaction between my GUI language and my code in C++. So, I decided to put aside the GUI language and program Trichromix without it. The core of the Flatland engine is solid, though, so I could keep that.
But then I realised that I was still going about all this the wrong way and I decided to run an experiment. I programmed Trichromix from scratch using just C++ and SDL. No Flatland engine, no GUI language, no perfect toolset. I've been working on it for two days now and I've almost finished Trichromix.
In two days time I have gotten a lot further than I have in the last two months! Sure, I'm not quite finished yet, but the core is done. I now have a game I can play, unlimited undo, a full-featured level editor, support for level packs, mouse and keyboard control. There are some minor features I still want to add, but I'm certain that it won't take more than a day, two at most.
My code is riddled with globals, both functions and variables. It still feels weird to me using them, but I know now of how great a value they can be. When I was implementing different game states, I had to refactor some of the global functions into classes and I was surprised to see how easy this was to do. Most of the stuff that started out globally, still is, though, since I had no reason to change it.
The source code I've written as an experiment is probably a much better choice for my final product than my previous code, so I'll stick with it. It could do with a fair bit of refactoring, but I'll probably put that off until after Trichromix is released. (I plan to update and extend Trichromix regularly.)
A very, very big thank you to Dustin Sacks and Boris Yankov for pointing me in the right direction.
For completeness sake, the little piece of wisdom that is the title to this blog entry was first conveyed to me by Codrin Kruijne, one of my closest friends. The quote is from the French philosopher Voltaire and translates to 'the best is the enemy of good'.
Back to blog index
Tell me what you think
Since I'm not updating this site anymore, I disabled comments. You can visit me at my new site: www.williamwilling.com.