I spent six months writing over twenty thousand lines of code for my game engine. Here is what I learned.