JavaScript is getting a lot of attention these days - but I would like to know what you dislike in JavaScript? What are the things you can easily do in other programming languages, but not in JS?
If the browser was the operating system, then JavaScript would be the equivalent of assembler on the browserOS.
People complain that JS is different for different browsers ... well, guess what, assembler has different implementations depending on which CPU you use. Let me quote: "a program written for one architecture won’t work on another one without a complete rewrite. High level languages solve this problem."
I remember the days when writing Pascal / C had pieces of inline assembler to improve performance in certain cases, these days compilers are so smart that writing assembler by hand is obsolete (unless you're in a niche market like the business of writing compilers).
Using a high-level language like Dart makes writing JavaScript by hand obsolete.
One of things are:
0.1 + 0.2 != 0.3
I want to remind everyone that JavaScript aka ECMAScript is just a standard that defines the language. That´s why there are so many variants on its implementation, because is up to the vendor (Mozilla, Google, Safari, Opera) decide how do they implement the features in their browsers.
When I was learning I didn't like a lot of it... because my head was hardwired to think in OOP or better said COP (Class Oriented Programming) that was my mistake. It was only when I let go of my old programming habits that I could embrace and start loving JavaScript. It is such a beautiful, flexible and powerful language now that I know it better.
JavaScript has a lot of advantages and none of the disadvantages of the COP languages like Java, C#, C++. It is not perfect, and it is not meant to be like that.
What I don't like about JavaScript is that its community has taken this long to truly show the power and capabilities of the language.
Further reading: medium.com/javascript-scene/the-two-pillars-of-ja… github.com/getify/You-Dont-Know-JS
JavaScript and other weakly typed languages suffer from the same problem. What's the easy way to distinguish between Number, String, Boolean etc? The same variable can hold different type of data during the execution of program. This is very confusing!
For me it's inconsistent implementation of == and === operators. However for best results it's recommended to always stick to === operator. Because of so many inconsistencies and bad implementations you can find several books on JavaScript best practices which I don't see in any other language.
For me the biggest demerits of JavaScript are :
The inconsistent implementation of DOM API. As a result, we need to use polyfills and avoid using any new technology/api that may break in other browsers.
It's very easy to pollute the global scope and there is no easy way to debug your code. No good way to organise and structure your code unless you use a framework like Angular.
Why don't we have multi-line strings?
Poor implementation of parseInt(). It treats strings with leading zeros as octal. You can of course pass 10 as the second argument to have better performance and consistent results.
It's object based - not object oriented. So, you don't have full power of inheritance and other cool OOP concepts. It's better to use something like TypeScript if you are a OOP fan boy.
Variable hoisting is pretty confusing and can easily scare off beginners.
Don't you think null and undefined are redundant? In my opinion we should have one of these (preferably null).
But JavaScript rocks outside browser environment (e.g. Node).
The Unix Tiger
Hacker Culture
A community of hackers with shared values and experiences who enjoy the intellectual challenge of engaging in a spirit of playfulness and ex
Pick any of