I Cannot Remember 2 Programming Languages at Once

Recently for some purposes I had to learn Python, seriously. Which normally I do not really care about writing Python myself, as I only bother to write C and Java, and let AI do the job of Python. But this learning experience actually let me discover something — the programming languages looks different, but they are all still similar in the context of logic, like for loops, functions and etc., but the syntax is not.

And that is where the problem come in. When your brain gets into the actual programming mind, syntax is just something called muscle memory, and what you care about is only the logic. "Create a loop" is logic, and output into code, it could be like for (int i = 0; i < 10; i++) or for i in range(10):.

My Problem

Muscle memory comes from the long time that you do something, and when the thing you do for a long time suddenly change, your muscles won't suddenly just change. How I experienced this is like so:

Morning: Writing C, you know that you need to

Afternoon: Writing Python, everything changed

The from C to Python transition is mostly very smooth, because it is just removing things, and it is easy to remove something.

But adding things back is a completely different story, and now you know that things are going wrong, and very wrong.

For example, I would do something like int = 23 inside C, as I thought that (1) I do not need to declare types, but you still have some memory of it, so instead of removing the int you removed the name of the variable. (2) Not adding a semi-colon, which is common.

Why Not Just Write Python?

The answer is of course — NO, and there are 2 reasons. One is that you need to keep the spirit of C, the spirit of freedom, and absolute deterministic and control to your software. Two, you kind of really have to use C, like what I mostly do nowadays — Valecium Kernel, and also some other high-performance network programs.

Rust is also not really an option, you can see my future blogs for why when I have the audacity to write so. And for other programs, Python just wastes too much memory, and it is much easier to just use Java if C does not have enough thing to do.

Another thing, is that Python does not have typedef, and does not have the same initialization methods as of Java, which made it very ugly to create your own classes, at least to me. Python is just something that I got forced to learn, and it is something that is somewhat useful in some strictly-not-necessary places, like builders, and random scripts.

And with the final reason being it is just way too slow and memory hungry, which is not efficient to run on a small lightsail or EC2 instance.


Support the Research

Follow Me on GitHub

I spend about 6 hours a week outside of my main work to write these deep-dives into C, Java, and systems performance. If my work adds value to your engineering toolkit, there are two ways to support the project:

One-Time Support

Simple way to say thanks for a specific fix or tutorial. Donate via Crypto (Any Amount)

Other ways to support

You can visting the Support for more ways to support me and sustain the blog community.

The Blogs