Skip to content

Why I like JavaScript

Every programming language has its oddities and challenges. When it comes to JavaScript, it has probably more of those oddities.  It’s not the just language itself but also browser support. Different vendors implemented slightly different JavaScript engines for years. It resulted in a ton of challenges. I dealt with these challenges myself.  Thanks to JQuery, we had a fresh air. Anyway, this isn’t the end of the story. Over the years, JavaScript improved a lot, really. In this post, I’ll go over JavaScript weirdnesses first and then try to explain why I like JavaScript.

The Weird Parts

I will directly go to code as it’s better to demonstrate than talk.

We can probably find more of these peculiarities but I’ll keep it short. Let’s focus on the new syntax.

The Good Parts

ES6 is a significant update to the language. It introduced a powerful syntax. I have been using JavaScript for quite some time but I like it more every time I get to use them. So, I’ll go over my favorite features.

The Default Parameters

I’ve first used default parameters in Python and it was charming. It simplifies the code by removing extra logic to cover null cases.

The Arrow Functions

I guess it’s not just me. Everbody loves arrows, it simplifies logic for filtering and mapping a lot. Note that, we have some brand new functionality like some and every. They are wonderful. You simply write less.

The Template Strings

The template string is just better way of constructing strings. It removes the challenge to format strings. It can also evaluate the logic inside although it might not be a very good idea to do so.

Destructuring assignment

This is truly magical. You can destruct objects and arrays. You can just get the property you are looking for easily.

I’ve gone through my favorites with the new JavaScript features. There are other great features like Promises, Classes and additional object methods. However, the above features changed my daily coding significantly because I’m writing less code in a much more expressive way. In consequence, JavaScript has been the bad guy for a while but it significantly improved. One can accept weird parts and avoid them.

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *