viejodani wrote:as you code for either games, libraries of software, there are certain mistakes we commit that affect the performance or behavior of the product. While there is a thread about Irrlicht glitches, I wanted a more general list of mistakes that we want to share to fellow developers so they don't make those same mistakes.
I got some experience in programming, so I guess I'll add a few comments

viejodani wrote:My first mistake:
multi-threading is a double edge sword, don't think that your game will be faster if you use a lot of threads, you will have serious problems with weird behaviors or synchronization problems.
Satan himself created multithreading. I'm sure about that. The first important thing is to *really* know what you're doing when trying that. Here at work I work on some projects that just spawn threads for everything, and this slows them down quite a bit. But I do some planning to make a multithreaded version of my IrrOde wrapper, but that would just be 2 threads, one for Irrlicht, one for ODE (maybe a third one for networking), but before I do that I have to get a stable threadsafe messagequeue finished.
viejodani wrote:My second mistake:
Comment your code after the game works. I forgot many times what a variable or function was used for and on editing the code I screwed up a lot
[megalomania activated]
I don't need to comment my code. I mean ... good code (e.g. mine) doesn't need any documentation, it documents itself. Moreover my code is so damn good that even the assembly code generated by any compiler is self documenting. I just need to take a small look at it and know what's going on.
[megalomania deactivated]

Just kidding ... It is definetely important to have at least little comments, if you don't touch your code for like 6 months and want to change anything you'll be in big trouble otherwise. Or, read in a signature round here:
Software documentation is like sex. If it's good you want more, if it's bad it's better than nothing.