The Only Programming Advice
Master the fundamentals.
If there was only one thing I could tell my past self, it would be to learn more fundamentals. That is the most important gap between me and better programmers. It's not having different programming styles, learning software development and project management, or learning new languages and frameworks; all these things are secondary at best. My goal in this blog will be to provide arguments for this statement.
1. The stack is hidden
Let's take an example of a simple dummy REST API written in FastAPI. Here is an example code that creates a get API that returns {"hello" : "world"}.
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def read_root():
return {"Hello": "World"}The code looks very simple. FastAPI is a great framework to write APIs. But there are a lot of things that go under the hood when someone calls this API. I am not going to go through the exact steps and codes that run to make the API work. But off the back of my head, I can tell a few things that has to happen in the fundamental level.
The FastAPI implements the HTTP protocol that parses HTTP requests and creates HTTP responses. (Fundamentally that's all a http library needs to do)
If the server supports HTTPS, the web server implements a tcp/ssl layer that needs to perform a handshake with the client and needs to encrypt and decrypt data based on the handshake.
In the operating system, a socket is bound to a port and IP address that the webserver can read and write to.
There are a whole lot more things that happen from the client side and the whole internet architecture.
In these different levels, the data is in different forms.
Basically, there is a stack. People call it the OSI model.
In the Python code above all these stacks are hidden. This is what we call in programming abstraction. If you want to be a good programmer you need to learn to see under the hood i.e. the OSI model.
"Just knowing how to use the library is like learning how to read and implement a recipe book. Knowing the underlying implementation is knowing the physics behind the food."
2. The fundamentals are simpler.
As a programmer, you should appreciate and seek simplicity.
"The simplest, most elegant explanation is usually the one closest to the truth" - Ockham
If you look at any fundamental parts of computer programming, it has really simple explanations. Here are a few things I believe to be fundamentally true even though it might not be the case in actual implementation.
A C pointer is just a variable that stores some address that points to a certain location in memory.
An operating system (kernel) is just a backend for computer hardware that provides a set of APIs for user programs to consume.
This is a call stack that is made by a Java program just to make a HTTP request. This is what I mean by “The stack is hidden and you must avoid having these stuff on your code at any cost”.
3. The fundamentals rarely change.
If you keep up with the latest programming news you know that there's a new framework or language in the market every day. There's always either an old language feature deprecating or new breaking changes in your favorite scripting language.
However, if you look at the fundamentals of computer science, things rarely change. The x64-86 architecture isn't going to get deprecated soon. Win32 API isn't going to change soon. Most of the fundamentals I mentioned in the second paragraph aren't going to change soon. I am not at all saying that these things aren't going to change at all. But, the fundaments are simple because they are designed to rarely change, they rarely change because they are simple. Softwares that are written in low-level language and don't use high-level libraries run on machines without breaking for years and years.
4. It allows for first-principle thinking.
First principle thinking is an approach to solving a problem by questioning every assumption about the problem. However, when you are in higher-level languages or libraries it already makes some assumptions for you. Python assumes that you don't need pointers to memory. Java assumes that you need a class to solve the problem. A web framework assumes that you need rest APIs. Well, there are assumptions everywhere. Even assembly has assumptions about the ISAs. However, learning the fundamentals will allow you to escape those assumptions. You could create your own communication protocols, your own data structures and algorithms, which will allow you to solve problems that have never been solved, which is what first principle thinking is.
"First you want result, Later you want control" - Eskil Steenberg
You cannot design a new communication protocol using FastAPI, you cannot design a new database engine using MySQL, you cannot write a new operating system on Win32 API. It is because these libraries are designed to give you results, to design something fundamentally new you need control, you need access.
5. Solving problems is more impactful.
As developers, our job is to solve problems. If you write a code that solves a problem, it matters how much people can access it. For example, if you write a code that does alpha blending for texture in Godot game engine, only the people who use Godot will be able to use the code. However, if you write the same code but just using Opengl or Directx, all the people can access it because all the game engines use Opengl. The problem and the solution code could be very similar but more accessible hence more impactful.
6. Programming is a means to an end, not an end in itself.
Programming is a tool, it allows to run code in the computer. The goal of any program is to solve a problem. But programming is also fun, people spend hours setting up their OS, their desk setup, their code editors and also their programming styles to be most efficient. It is what ted called surrogate activity. I don't consider it a bad thing, but changing the language you write on, changing the ide or operating system just because it's more aesthetic or just because it makes you look smart is stupid. People who brag about using [Lin-ux] or terminal are on these category.
Your problem should define your code structure and language. Having fundamental knowledge about computers and programming allows you to mold your code according to the problem. A lot of things like your editor extensions, libraries and even operating systems are made or used as surrogate activity. Just avoiding these things should make you better than the average programmer.
Sticking to the fundamentals is the only way to stick to the problems and not worry about the cosmetics. You don’t solve problems by updating to the latest libraries, making your desktop look “based” or by creating abstractions around the problem. You solve the problem by solving the problem .



