What I realised after learning Python, TypeScript and Kotlin

Remember all those people who kept saying that once you learn one programming/scripting language then it’s not too difficult to learn another one? Well, they were telling the truth. I have known Javascript for years and I decided that I should expand my skillset even more because knowing more languages and being a polyglot just makes you better equipped to work in different roles. I would not say that I have mastered any of them yet as its only been a month or so but I have noticed that the languages share many similarities. Here are some examples below in each programming/scripting language.

Programming Syntax

Variables

Python

TypeScript

Kotlin

Arrays/Lists

Python

TypeScript

Kotlin

Objects/Dictionaries

Python

TypeScript

Kotlin

Functions

Python

TypeScript

Kotlin

Control Flow: if statements

Python

TypeScript

Kotlin

Loops

Python

TypeScript

Kotlin

Import Statements

Python

TypeScript

Kotlin

Conclusion

This was just a sample there are more areas like Classes which I did not mention. When learning all of these different programming languages I noticed many common themes between them. For example the data types are very alike. The way that you assign variables for example feels very similar. Python just lets you write the variable welcome = 'Hello World' whereas TypeScript and Kotlin require you to assign it a type first. TypeScript being a superset of JavaScript essentially means that you are still compiling to JavaScript. So assigning const and let before you write your variables or var if you are writing it for ES5. In comparison Kotlin uses val and var for variable definitions with val being the equivalent to const as it is immutable and can't be re assigned. The way you write your syntax just feels so familiar so switching between languages is a breeze once you learn the fundamentals.

Also logging to the console is almost exactly the same. Python uses print() TypeScript uses console.log() and Kotlin uses println(). Python and Kotlin are almost the same which makes it easy to remember again. Creating Data Structures like Arrays/Lists, and Objects/Dictionaries is just as simple if you look at the syntax. Interchanging between languages is a breeze. Python Dictionaries look just like JSON so if you know JavaScript this syntax is familiar already.

I was also amazed to see that functions look very much the same. The caveat here being that Python does not use curly braces like TypeScript and Kotlin. Instead you use : and you have to be aware of the tab spacing otherwise your code won't compile.

The control flow is much the same writing if and else syntax works almost exactly the same in all three languages. And when it comes to doing looping you can clearly see that syntax for Python and Kotlin looks almost identical. One pretty big difference between the 3 is that Python uses snack casing for variables such as first_name whereas TypeScript and Kotlin use camel case like firstName.

Lastly import statements follow a familiar pattern across all 3 languages. I used to believe that learning too many programming languages would lead to yourself becoming confused as you have to remember all of these different syntax and you could find yourself in a scenario where you are writing Kotlin in JavaScript for example which I’m sure has happened to some developers at least once with multiple languages. But actually it just makes you a better coder as you begin to grasp the fundamentals of each language a lot better and your understanding of the core concepts deepens significantly.

So as you can see they are very much alike. Learning multiple languages definitely opens up more doors and allows you to progress further as a developer.

👨🏿‍💻 Full Stack Developer 📝 Blogger 🎮 Gamer ✏️ Creative 👁 Anime Addict ٩(●ᴗ●)۶

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store