How to learn programming

This post is aimed at people learning or wanting to learn how to program in an efficient and non time-wasting way. Most of the points I make don’t just hold true for programming but also for learning basically any skill that takes time and practice.

About passion

First off, lots of people tell themselves they are too old to learn new stuff or get discouraged by seeing a younger person doing better than them. This is complete BS and doesn’t matter at all. Maybe you have thought about how good you might be if you had started let’s say 5 years ago. This train of thought is stupid and just creates unnecessary frustration. The best time to start learning was in the past, the second best time is now is a statement you might have heard already and I completely agree with.

I started programming relatively early at the age of 13. I wanted to write Minecraft mods at the time so I watched some YouTube tutorials to learn Java and basic modding and from thereon experienced with adding various random items, blocks etc. Computer graphics was my main interest at the time so I also learned SFML and OpenGL in combination with C++ to be able to take on simple 2D projects or a crude 3D voxel engine. I then learned NodeJS, Python and shell scripting for writing Discord chat bots, creating APIs and automating workflows. Nowadays I mostly use C as I’ve been doing lots of osdev related things.

Did you notice the common theme in my process? I never learned a programming language or a technology just so I know the technology. This is an essential point you really need to understand. You always learn a technology to be able to use it for your own goals. This implies the necessity of having an end goal in the first place.

An end goal is not clearly defined and can be everything you want it to be. In my case, it was Minecraft modding because I like the game, computer graphics because the mathematics behind it interest me and JavaScript/NodeJS because having a chat bot with lots of functions is really convenient. A specific type of goal is the educational one. I do osdev because I want to know how operating systems and generally speaking computers work. If you wanted to learn a specific language like C++ because you are really intrigued by some of its features, this is a type of end goal. Learning to use C++ because you think you might need it later on without having a concrete conception of what you need it for exactly is not an end goal.

Knowing what you want to do is important, but you also need the right amount of dedication. You should not be afraid of sitting in front of a computer screen for hours each day and reading hundreds or even thousands of pages of technical documentation. You have probably also heard about frustation tolerance. What people don’t tell you is that it’s not about not being frustrated, but about not giving up due to frustration. Every time I encounter even the slightest bug or my program doesn’t exactly do what I want it to, I start getting angry and wanting to shout at my computer for disobeying me. I get frustrated extremely quickly, but that doesn’t matter because I can easily continue working on fixing the problems. In a way, frustration fuels my most productive developing sessions because every roadblock only makes me wanting to overcome it harder than ever before. This is what I call dedication.

The combination of having an end goal and dedication is called passion by many, including myself. You will need passion to be able to become a good developer. This means finding an end goal, which you can do actively, and having enough dedication. Whether you have enough dedication or not is a question only you can answer. If you think you do, great! If you don’t think so, try it anyway. Even if you fail you probably end up learning a lot about yourself and can improve how you approach problems.

Programming is not harder than any other thing you might do. It is just not something for everyone, especially not for people lacking interest or frustration tolerance. If you have these soft prerequirements, you should be fine. The actual knowledge, ability and experience comes with time.

And how do I actually learn then?

If you just decided you want to do software development, you can ignore the above rule and start without an end goal. I recommend searching for a Python tutorial which will teach you the basics of the Python programming language. It is now that you will notice whether you have enough dedication because lots of people will quit at this stage. You should learn the basics about variables, conditional statements, loops and functions. No need to take a look at fancy algorithms, just the core principles of programming.

There are multiple approaches one might take next, but there is something that needs to be done first, namely setting your end goal. You should have a pretty clear picture of what interests you and what you want to build. Say you really like video games and want to create a video game.

Every time you have a question that you don’t have the knowledge to answer, consult the search engine of your choice. Applied to the above example, you’d probably google how to create a video game. You’d then read lots of articles to inform yourself on what skills you need. With video game development, lots of people will probably tell you to use a game engine like Unity. You will then find out that to program your game, you need to know C#. You should then work through a tutorial playlist or online crash course to get to know the syntax and language basics.

Now you should stop watching C# tutorials. There is something called tutorial hell. Simply speaking, it’s the feeling of not making any progress despite of working through tutorial after tutorial. This has quite a simple explanation as you are not working towards your original goal and applying your knowledge. Even if you just know the language basics and it’s hard to write code, you should keep up the struggle because this is where the real learning process takes place.

Not applying your new knowledge is the same as not having learned it in the first place. I had to experience this when I learned Rust a while ago. I thought Rust was interesting and started working through tutorial after tutorial, but felt like I was making no progress at all. I then quit it and forgot almost everything. This was due to me not using my skills on actual projects to practice.

That’s basically it. Get to know the basics, then set a goal, learn the basics of what you need for your goal and then immediately start working. You don’t learn to correctly use advanced features by working through more and more tutorials, but by encountering situations in which they become necessary and understanding why. Advanced information can of course also be obtained from tutorials, but once you finish the basics reading proper technical documentation and asking good questions on forums is your best bet to gain exactly the information you need.

Keep those things in mind and given enough time, you will become proficient before you even notice. Happy coding!