Software, Privacy & Freedom

Learn Programming, Not Languages

· 4 min read

Though a bit hypocritical coming from someone who has learned a few dozen programming languages I think you should learn programming and not languages. Now don’t get me wrong, learning languages is great and fun if you are into them, but you shouldn’t focus on solely learning tools instead of practices. Programming languages are just that, tools to accomplish a given task; you can have a preference for a certain tool, and you can learn to use multiple tools efficiently, but that’s it.

Applicability of skills

Let’s say you’ve learned Python and have mastered it. Great! Now how are you going to create an interactive website frontend with it? Leaving WASM aside you are going to have to use JavaScript to accomplish this given task.

Next you are working on some system in the frontend and want to use a dictionary you’ve learned to use in Python. But wait, there is no dictionary in JavaScript! You start panicking a little and search the internet for an answer. You find out that objects are actually just like dictionaries. Great, now you just use objects everywhere.

In your ignorance you have completely skimmed over the fact that JavaScript has hash maps. That is the closest alternative to Python’s dictionaries and have certain benefits over objects in JavaScript that I’m not going to list here. The important thing to notice is that objects behave similarly to hash maps and thus may work in your use case while not being the most idiomatic or optimal way of doing things.

Now you might start to notice the problem here. If you had learned the underlying concept of a hash map in Python’s dictionaries you would have searched for how to do them in JavaScript. You would have found out that there is a Map in JavaScript instead of using pure objects. This was all due to the ignorance of learning a single language instead of programming concept.

Going low-level

Continuing from the previous example; even if you know what hash maps are do you know how to implement one? Learning programming concepts doesn’t only mean that you know what they are but also that you know how they work. The benefits of knowing how they are implemented, at least from a theoretical point of view, are numerous.

When you know how hash maps work you understand that you can search in Θ(1) time, which is faster than the arrays average Θ(n) time. This information lets you make educated decisions based on your needs for the data structure. In most cases this is a matter of your application working in linear time or constant time which means you have to scale exponentially or linearly respectively.

This level of understanding also benefits you if you ever find yourself in a situation where you actually have to implement something from scratch. When working with C for example you don’t have hash maps or fancy dynamic arrays. I know that many programmers nowadays don’t have to work on this level if they don’t fancy it, but you should still prepare yourself for the worst.

What to do?

My main recommendation is to intentionally limit yourself in order to learn the basic programming concepts. You know how to create a simple HTTP web server with Node.js and express in 3 lines of code? Great, now do that in C with Berkeley sockets without any (other than the standard and system) libraries.

This may sound a bit hardcore, because it is, but I feel like this is the only way to truly learn these things. You have to start from the beginning and slowly work your way up the layers of abstraction we have nowadays. You should also expand your perspective by learning multiple vastly different programming languages and techniques.

“If the only tool you have is a hammer, it is tempting to treat everything as if it were a nail.”
— Abraham Maslow


Have something to add? Don't hesitate to email me.

Written by Human, Not by AI