Why Are Programming Languages Looking More Like JavaScript?
Alex Howez
Posted on December 25, 2023
In 2023 I started testing a lot of new languages and saw newer languages copying JS syntax, and for good reason! JavaScript is one of the most popular and widely used programming languages.
While initially I thought I was biased to the JavaScript syntax, apparently more and more languages are copying it's style.
Did JavaScript prove it's readability and visual scalability?
**
The New Languages
**
Take a look at Carbon, Google's new programming language that aims to be a modern and expressive successor to C++, designed to be compatible with existing C++ code and libraries.
The use of arrow functions, the way to declare variables and for loops, you can always confuse this with Typescript!
As a reminder on JavaScript's plasticity, bracket "{}" symbols are optional, same for arrow functions and the same goes for spacing (4 space vs 2 space vs tab spacing).
Below is the same function, written in different ways.
**
It's also Kotlin
**
Another example is Kotlin, a programming language that targets the Java Virtual Machine (JVM) and can interoperate with Java code while being more concise and expressive.
It's a language that I'm interested in, and looking at it's documentation I couldn't help but notice the JavaScript similarities again. Curly braces for blocks, semicolons for statements, and var/val for variables.
Looking at the Kotlin/Java comparison, you can see how Kotlin drops the variable declaration in the "public final int id" in favour of "val id: Int".
**
And also Rust?
**
I'll leave the same example in Rust for fun, another one of the newer languages with this same syntax look.
Final Thoughts
In my opinion, Python's ease of writing shortcuts make it harder to read on larger codebases, while Java's intricacies make it harder to read line by line.
On the other hand JS/TS or strike a great balance in the middle.
What do think?
Posted on December 25, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.