How (not) to learn a new programming language (or, in fact, programming in general)


Table of Contents

Introduction

Hi. I’m your average beginner game developer, that is average – at best – at C++. I swear I am normal about C++ template metaprogramming and totally did not write illegible concepts and requires clauses that makes eldritch beings cry!

Currently working on my own game engine (Video progress demonstrated here), while also making music, art, and other things.

Before I became an expert noob at C++, I was a beginner noob at, well, pretty much programming entirely.

I had dabbled in game development via Godot (which is a game engine I really love) in the past, making (but not finishing) a simple, danmaku-style, Touhou x Len’en fangame. I eventually decided to abandon it, due to being too lazy to figure out how to optimize the bullet system.

The quest to make a game

Eventually, I decided to finally start working on my own original game series that I had been wanting to make for quite a while. At that point, I had come across a problem: which game engine would I use?

I originally wanted to use Godot, but ultimately had to be discarded due to not being able to get GDNative working, and I couldn’t figure out how to use C# in it.

The other popular options were Unity and Unreal:

So, I was left to search other engine options.

The search for a game engine begins

After some searching, I came across two possible engines: Danmakufu and LuaSTG.

They were both danmaku-specific engines – the “RPG Maker” of bullet hells, as I would describe them.

I had first dabbled with Danmakufu, since it was the most popular of the two. I ultimately decided to ditch it, mostly due to its way of doing things, which i did not enjoy. Still a good engine regardless.

Then, I dabbled in LuaSTG. Between it and the previous one, I would prefer to develop games in this one. The third-party editor available for it – LuaSTGSharp(X) – is a really powerful one, and also really enjoyable to use. Although, I would recommend LuaSTGSharpX instead of normal LuaSTGSharp, since it contains more features.

If it is so good, then why did I ditch it? It’s simple, really: there was a very, very big drought in documentation and tutorials – at least in English. There was more in Chinese, but I do not speak Chinese (and machine translations are never good).

It also felt, like, wrong to use them? Like, they were made for touhou fangames and such, so it feels weird using them for an original series, at least when I do it. Other devs can do whatever they want.

After this failed search, I decided “you know what, I’m just gonna make my own engine, In C++!”.

The search changes to looking for a 2D/3D rendering engine

And so I began making my engine, around the beginning of 2022. Around June to July of 2022, I had to make the decision I most dreaded – the graphical rendering.

With making your own game engine, you must make your systems from scratch, or utilize another system already made. In my case, the only system that I, at that point, hadn’t made from scratch, was the collision checking system – partially, anyways.

So, the search for a 2D/3D rendering engine began.

Here’s all that I’ve tried, and the reason I ditched them:

Eventually, I tossed in the towel. “Fuck it, I’m just gonna suck up and learn OpenGL again.”, I said to nobody but myself.

Learning OpenGL via SDL

One thing that I did not mention, was that I had dabbled in learning OpenGL in the past – before I even began work on that fangame I mentioned – via the learnopengl.com tutorials. I eventually gave up on it, because I decided to do the lessons overnight, ended up sleeping at 6 AM, and when I woke up I could not understand the code anymore. Great book, and I still sometimes use it for shader & other rendering stuff.

That had left a sour taste in my mouth for GLFW (I know, really stupid reason to do so, and yeah, very much due to my fault), so I decided to search for a tutorial with a different library. I eventually found this really good OpenGL + SDL tutorial (I think it was this one), and went to town with it.

Instead of how I previously tried following a tutorial (exactly as it was being taught, with zero deviation), I decided to, instead, incorporate what I’ve learned directly into the codebase of the engine. This had a huge payoff, as I both ended up learning how things worked and also was developing my engine! It is also, to this day, my preferred method of learning new concepts: by immediately trying to apply them to an aspect of my engine, or any other project – helps make it stick.

From then on, the rest was (commit) history.

Overall? 0/10, would not recommend

Even though this journey may have deepened my appreciation for game development, and my understanding of modern C++ – more specifically C++20, would I recommend this be a way to learn a new language, let alone programming in general?

For learning a new language? Maybe.
For learning programming in general? Probably not.
For learning both simultaneously? Absolutely not.

For learning C++ and programming simultaneously? Fuck no, are you insane!?

But why not? well, it’s quite simple.

Firstly, C++’s learning curve is steep. It already has a high difficulty at the start, and that difficulty only increases the further you go deeper into the language. Although, once it clicks in your head? Ohoho, it’s on, baby! Though, you may potentially lose your sanity the deeper you get.

Secondly, making a video game engine is a monumental task. You have to figure out your solutions for your entity system, your graphical rendering pipeline, your program management, your own vector & matrix systems (if you decide to do your own), and a giant amount of other things.

It becomes even harder especially if you make a very non-standard one, such as mine. At this point, I’m pretty sure I might need to make a custom 3D modeling suite for it, since it has its own custom renderable object format – with a file format to boot!

Combine all of these aspects together and you have a colossal mountain to climb, with tons of pitfalls to catch you off-guard.

But, if you would still like to take on this journey…

The journey is always fondly remembered

Trust me: you’ll find it an enjoyable experience.

You will cheer when your systems are working how you wanted. You will groan when you get errors and segfaults. You will end up finding joy in programming, and will come to love whatever language you choose. I certainly grew to love C++, despite its flaws.

And you will look back at the time you spent writing, and be proud at how much you’ve grown since then. And you’ll look towards the future, excited at what new things you can learn.

And then you’ll scream expletives because your program just crashed with another SIGSEGV.


Tumblr: https://lasagnacake.tumblr.com/
Cohost: https://cohost.org/LasagnaCake
Itch: https://lasagnacake.itch.io
Bandcamp: https://lasagnacake.bandcamp.com
Youtube: https://www.youtube.com/channel/UClnktpZm3iVz7uKRQ8JHhzw