Thursday, 3 March 2011

Never Reinvent the Wheel

In these days I'm writing a small roguelike. I started it in Java, but soon I moved to LÖVE, a framework for 2D games based on OpenGL and Lua. After some days I've got "something working" (moving camera, smooth characters, entities, doors, items) so I reflected about the "reinventing the wheel anti-pattern".
As a programmer, I enjoy to write code. I tried many times to write an OpenGL 3D engine; I tried many times to write a 2D platform game engine. But after all, is a good idea to write yourself all this code when somebody already did it?
Obviously no, but believe me: to reinvent the wheel is a strong temptation and, often, we follow it unconsciously.
Don't invent your own configuration language: there's already Lua.
Don't write your own 3D engine: there's Panda 3D, Crystal Space, Irrlicht Engine, Ogre 3D, the various ID Tech (now they're under GPL).
You'll earn time and you'll see result sooner then you think, allowing you to give more attention to the most important things of your program.
Post a Comment