Learning Multiple Programming Languages

Hello, Everyone
I have been learning Python for over 1 year, and I am really loving it. I mean, it is hands down the easiest most comprehensive programming language to learn. I am at a point in which I have intermediate skills in python.

Recently, I picked up javascript, because it is the most popular programming language out there. And since I enjoy front end development, Javascript is at the fore-front of web development.

In this industry, one is required to know 2 or more programming languages. My question is this, how do you become proficient (professionally) in both language (Python and Javascript). I would love to just stick with Python since it already a multipurpose language, but I cant.

1 Like

They’re pretty similar, so it’s fairly easy to switch.

Generally speaking most Python code maps almost directly across to modern JS (with specific differences); you can often rewrite python code as JS code almost line-for-line.

Fairly major things to note: Standard library in JS is nonexistent though (it’s designed to be a very small language), that’s the most immediately obvious difference, you have to rely on external libraries. Umm. And it is single-threaded. And it is very weakly typed which will bite you hard. And OO will be a bit weird. But functional style programming is generally much easier. And you don’t need to worry about whitespace (well, 99.9% of the time). And there isn’t the Python 2 => 3 thing.

IME, on average it seems to take about 3 years to get confidently good at a language (give or take, and in retrospect not necessarily actually good). Second languages and so on generally will take less time, and the effect is cumulative. And in terms of time, much, much less if they’re very similar to ones you already know.

Indeed, and here’s a code snippet showing how similar Python dictionaries are to JavaScript objects, as one example:

# Python
tel = {'jack': 4098, 'sape': 4139}
tel['guido'] = 4127

// JavaScript
tel = {'jack': 4098, 'sape': 4139};
tel['guido'] = 4127;

IMO, Python and JavaScript are similar enough that you shouldn’t bother wasting your time learning both. I’d recommend against Ruby as well, because it bears some similarities to Python. (Python, JS, and Ruby are all very loosely similar to each other—learning one of them will make learning another of them basically moot.) Learn a different language—perhaps something in the mold of Java/C#/C++ (classically OOP languages with strong, static typing), or something purely functional (Haskell, Clojure), or a trendy language like Golang, Rust, or Elixir.

The biggest difference between Python and JS is that Python follows the classical OOP paradigm, while JS does not. OOP can be a very good thing to learn, but it’s not the end-all of programming paradigms.

To answer the question of how to become proficient: just build stuff and code a lot. Start with small programs like algorithmic challenges, then when you’re good enough, you can move on to creating full-stack web apps.

1 Like