On Implementing Things From Scratch

Last updated at 9 May 2021 at 6:00pm


Someone recently asked me why I would want to write a game engine from scratch instead of using the ones that exists. So I thought I’d write about why I like implementing stuff from scratch and why you should or should not.

Why I do it

Firstly, you have to understand why I’m writing yet another engine or math library or css library. Implementing stuff from scratch is not only fun, but also very educative. I’ve been developing a css library that is meant for small prototype web apps and it has been very educative. The knowledge that I had for css was acquired through googling on need basis. You want to center a div, google, want to change fonts, google, create a sticky navbar, you know it. Such simple tasks I now can do without any references. (Don’t get me wrong I am not against stackoverflow or googling). I got to learn and appreciate interesting things about css. The same is happening as I develop the math library, I have learned about SIMD intrinsics, I will now be using it more often.

Secondly, there is some feeling that I get when I create something from scratch and get it to a useable state. It tells me that given time and resources I could implement a fully featured web server or an operating system.

New tools and alternatives to current software come up quite often, and some of them win over the hearts of the users. In the process of implementing something from scratch you might come up with a new concept or new way of looking at things that will challenge the status quo. You might say it is reinventing the wheel but, I don’t really see it as reinventing the wheel, because for it to be reinventing the wheel there has to be a wheel. In some scenarios we still have not reached a wheel, it’s still being invented.

Lastly on a lighter note, here is a scenario. The year is 20XX JavaScript has become the go to language for most programmers. No one wants to do low level stuff, no one can except for the old ones. Fast forward all the old people are gone. You are now left with JavaScript developers who only know how to program web stuff. The art of systems programming becomes history. A branch of programming is formed that is basically archeology except this time it’s goal is to try and discover how our ancestors were able to write browsers and operating systems.

Why not

For obvious reasons your web server that you did from scratch as a learning exercise is not the best tool to use if you are developing an important system.

Also you have to factor in your timelines and cost. If you are on a tight budget and timeline then implementing a program that does something that the one that exists does is not such a good idea.