Python vs Javascript

This is my follow-up opinion regarding a poll I posted on Mastodon recently.

tldr; I think Python is a fine language for non-programmers, and is a decent tool for certain tasks. I think Javascript is mostly terrible, with only a few redeeming qualities, and I now actively avoid using it wherever possible.

Background

First, I expected “Python” to take the majority vote, but also expected “Both are bad” to be the runner up. I find it interesting that “Both are good” and “Both are bad” were so close. I’m not surprised at all that “Javascript” had a low score.

To answer the straightforward question, my vote would be for “Python”. But, I’d like to give a quick history of my background with both languages, which I hope will explain my position.

Python

Python was my first language, and I’ve continued to write Python here and there since ~2012 (holy shit, really?). After using it as my “learning language” I had a spell where I kind of hated it. The syntax bugged me and I had this thought, “Why would you write in a dumb slow interpreted language like Python when you can write in a superior fast compiled language like C”?

I think a lot of my negative attitude towards Python came from a genuine desire to be a really good programmer and thought that I should only focus on learning “the best” languages. I actually spent a lot of time this year trying to find that “best language”–and it actually led to depression and lack of motivation, but that’s a story for another time.

Now, within the past couple of years I’ve learned Pandas, worked on more data-science projects, and spent more time learning how to properly document and package Python projects. I’ve come to appreciate Python for what it can do, and to understand its limitations. I now understand it better and I have become more able to know when to reach for it, depending on the job I have to complete.

My feelings are ultimately “Python is okay sometimes, use it when it makes sense.”

Unfortunately, I haven’t quite reached that understanding with Javascript…

Javascript

During my first 2 years of projects at my first (and current) job, I wrote almost exclusively in C#. It wasn’t the C++ systems programming position I really wanted, but I was happy. C# had a static type system, what I considered to be a sensible syntax, and, heck, I actually really enjoyed writing in it.

But our API was written in Java, the evil illegitimate father of C#, and I harboured a dislike for it that caused me to frown every time I had to work with it. I realize now that my ill will towards Java was probably more a result of having to deal with the framework we used rather than the language itself, but after 2 years I decided to make my first big proposal at work and say, “This Java API has to go. Let’s throw it out and grab an intern to rewrite the whole thing.”

I spent the time to research options and eventually settled on Express.js. At the same time I was also preparing to start work on our web client and my research into that solution ended up with Vue.js. Looking back, I’m pretty sure that my reasoning was something along the lines of, “This is a web client, so I should use a web language. Well, it looks like Javascript is ’the web language’ so I should use a Javascript framework. Since I am using a Javascript framework for the web client, I should use a Javascript framework for the API. Also, Javascript developers are easy to find for when we hire more people in the future.” I do stand by my rationale for consolidating languages, especially in a small company, but I wish I had broadened my search to more possibilities. Maybe I would have chosen Elixir, Go, or some other language that is probably better than Javascript. I still haven’t learned those languages yet, so I really don’t know.

What I do know is that I am sick of writing Javascript. I don’t think it is a performant language, I’ve run into so many “dumb” mistakes that may be my fault, but I feel that Javascript let me make them. And now that I’ve become a more cautious privacy-seeking (tinfoil-hat wearing) member of the internet, I also see Javascript as the sick toxin coursing through the veins of the internet, making the web a shitty place.

My feelings for Javascript may be a bit over-the-top, but the poll results make me feel a little more justified in my prejudice–it doesn’t seem many people are ready to stand up and defend Javascript’s honor.

And if I’m wrong, that’s okay, because Javascript isn’t going anywhere soon.