DEV Community


Posted on

How I started coding

Why did I start coding, how did I get there and what am I doing today? In this article, I'll give you a little insight about how I got there where I am.

Alt Text

My childhood

I always loved to "create" my own things. In my childhood, I enjoyed drawing, I had a lot of fun building stuff with LEGO and played with other toys. My family is a bunch of gamers. I grew up playing a lot of Nintendo 64, and also some SNES or Game Boy. What I created on paper or LEGO was often inspired by my favorite games. I'd like to create my own games.

The PC era

When I was around 12 years old when I started using the Windows XP PC from my father. I enjoyed creating formatted RTF documents and drawing in paint. Writing down ideas for games or taking notes about my favorite games, such as character stats or cheat codes.

Eventually, when searching for ways about how to create own games, I found Game Editor and Game Maker. Since our computer also had Ubuntu as a secondary OS installed, I was sometimes on Linux and sometimes on Windows. On Linux, I used Game Editor, since Game Maker was only available for Windows. When I was on Windows, I preferred Game Maker.

During this time, I discovered many other technologies. I got familiar with HTML, PHP and MySQL. Also, I found a very interesting programming language which many game developers seem to use: C++.

There was a German website teaching everything about C++. How to compile code, what are data types, functions, parameters, return values, classes, how to write something into the console and more. I believe almost everything I know about coding I learned from that single website.

I wrote some simple terminal programs, such as a "guess the number" game. Unfortunately, it took quite a while until I found out how to actually create a window and draw on it. Everything the C/C++ standard libraries provided were related to the terminal, files or data structures.

One day, it suddenly became clear to me: there is a so called "library" that allows you for playing music. The download contains .h header files, but there was also a .lib file. Somehow I managed to "link" that lib file into my project, call functions as described in the lib's documentation and compile. And there it was! I had a console window actually playing back some music! Now I thought I know everything I need! Find another library for creating a window and drawing on it, and finally you can really create anything you want!

So my first graphics library I found was Allegro. It allowed me for creating a window, draw something on the screen and do something on user input. I created my own Pac-Man clone this way and it's still enjoyable to play.

More C++ stuff

I believe I used Allegro only for that single project only. I discovered SDL soon (it was still version 1) and I started quite a lot games I wanted to make. One of my projects even had more than 10 complete restarts from scratch. I was always unhappy with some aspect of the coding or I had an idea how it should work even better.

In the middle, I also found SFML as an alternative for SDL and did some stuff on that, just to switch back to SDL later again.

Web development

Independent of my game development experiences, I also started on web development. I originally started coding with PHP and MySQL. In the beginning I didn't use any kind of frameworks at all.

I was around 20 when I learned about JavaScript during apprenticeship. The most confusing aspects about that language for me were callback functions / closures plus them using variables from the outer scope. But, it didn't take long until I started to learn that language really much!

node.js got my attention, I found an alternative to PHP for coding the backend of a website. I started to create a few projects based on node.js. Later, there appeared TypeScript which allows for types and interfaces. I love the impressive and exact code completion available in editors like Visual Studio Code when working with TypeScript, while missing that accuracy in JavaScript.

Electron, a framework that allows for creating desktop applications using web technology appeared into my life. I was wondering: should I stick to C++ for game development or shall I switch to Electron?

C++ vs. Electron

I started coding applications as well as games in Electron + TypeScript. Some of the best points of game development in this combination in my eyes are

  • easy to code
  • awesome debugger
  • finished program can be distributed to Windows, Linux, macOS and even the web out of the box!

But, C++ also has some benefits to offer:

  • smaller binaries
  • more control over everything
  • if done right, better performance

So, I was struggling what to actually use for my game development. The story is not over yet.

Where are my games?

I created a few games in Game Editor, Game Maker and C++. Many of them are really small, based on existing graphics and sounds, and most of them aren't even nearly finished. I'm not particularly proud on any of those old projects, so I don't really advertise them.

There are a few ideas for different games I want to develop and I'm eager to get those games that way I imagine them. I hope, soon one and another of those will eventually become finished and shared with the world. Having people all over the world playing games I've been imaginating since childhood might be my greatest dream.

Thank you very much for reading! Feel free to leave comments below :)

Discussion (1)

hassan_k_a profile image

an excellent read. it will be a wonderful idea if you start to make a tutorial on moving from web development to game development or how to employ existing knowledge in field of web development in to game development. as you have great experience in the two fields.