Sunday 16 March 2014

Simplifying the source code

I have some problems with updates of the screen and parts of it during a game turn. I've tried to simplify the gameloop, but it still has some bugs like how alcohol content is not updating and stuff like that. It somehow became too complex and started to produce bugs as a side effect of that.

On the other hand my programming has become simpler. You only need the simplest possible way to solve or implement something. The problem is how humans overcomplicate everything and it's often evident in the source code. As a related item the source code of Incursion (by Julian Mensch) is going to be released, because I guess it outsmarted the developer himself. I remember him talking about the elaborated custom scripting and other weird stuff like that which likely became too complex to maintain.

It may prove to be another example of making things too complex, while simplicity would work much better. I have my own problems in Teemu even it is extremely simple itself as a roguelike project. That's why I believe you should simplify the source code when things start to look complex.

Simplifying is not optimizing. I have stopped trying to optimize my code for years now, because it's often a waste of time. Besides when you write simple code it also will probably be fast, because there is less source code and less structures to handle. The actual optimization these days is done by the compiler which handles that stuff much better than a programmer.

No comments: