There were bad design decisions made with JavaScript (for example; the handling of this ); we have had “JavaScript: The Good Parts”, for a reason.
But ES6 improves upon the above said bad parts; introducing keywords like let, const; and better handling of this through fat arrow functions.
My question is this — With ES6, would you still say that there are any bad parts left… (I am not talking about the lack of features) in JavaScript; ones that are still to be addressed?
Some would argue that class is the new bad part, with ES6; but that is debatable.
Curious to know the opinions of the JavaScript pros in here?
but that is debatable
Everything is debatable. Even what were (or are) "bad parts" might have been good for many people.
Any version of js is a programming language and, as such, it can be used to make anything, using any feature of the language one sees fit. Bad patterns are in the one writing the code and are language-agnostic. Further, a "bad" pattern itself is only bad depending on context, and viceversa.
That's true for js before, now and after; it's true for any Turing-complete language.
That's why I've never agreed with the idea of "good" or "bad" parts of any language. It always sounds, to me, as an excuse for one's poor code. I doubt that bad code written because of the "bad parts" of a language would be any better in a language that doesn't (or is not considered to) have those "bad parts".
It's like if authors were to excuse bad reviews of their novels because the languages they wrote them in are "bad".
In short: Not really, because there's no "bad" js IMO; there are bad js coders, like in any other language.
No, and never really!
ECMAScript need to be backward compatible, which means old projects runs in newer engines. As a result, the bad part is never really gone. Just we get armours, which is also heavy, to prevent us from hurting us frequently.
There always will be good and bad parts in everything, mostly, because it always depends on perspective from which people are judging a subject, their past experience, preferences and expectations.
JavaScript is a simple and powerful language. The problem with any technology is - people don't want to understand the culture of the technology itself, which is a very important part of it which can't be ignored.
Because of that we see today so many overcomplicated things. People ignoring the language itself and trying to use it in a wrong way by simulating "classes" and "interfaces" from other languages like Java. This will never work.
People blaming JavaScript for being JavaScript. It IS a weak typed language with prototypes, without classes and which is designed to script the browser with simple API and to be used by people without strong knowledge of software engineering and programming languages.
People blaming JavaScript for their own commands they give to the language. For example immutability is not fault of the language, it is fault of the engineer. Moreover in JS there is an Object.freeze() and people are using libraries for that task...
There are many other languages and platforms around. If you don't want to understand the culture and you don't like the language, it is not language's problem, it is yours.
You can write great modern applications, you can write simple, maintainable code in vanilla JavaScript if you will:
Master with a needle may achieve more then a student with a sword.
Nothing is perfect in the real life and never will be. You can't change what is around you, but you only can adapt and change yourself.
Even if ES6 was a major upgrade in the language for many years, it doesn't eliminated all the bad parts and never will be. Highest-level and flexible languages are always a trade-off. What you can do is to contribute to the ECMAScript standard discussion and development.
The only true bad parts in the JavaScript are the minds of bad engineers.
I would say no. Overall it's an improvement and adds certain sorely lacking features and data types, but the new version also added quite a bit of sugar as well. I've tried to list some of my main gripes below.
Overloading Semantics
Sometimes overloading semantics of characters leads to weirdness. Consider something simple like this:
const onClick = () => ({ ... }); // Note the braces as I'm returning an objectThere are little details like that to remember that feel confusing the first time you encounter them.
Immutability Weirdness
Even though it's a better language, there's still some weirdness to it. Given I prefer functional style, my biggest gripe has to do with data types. JavaScript is still lacking proper data types that were immutable out of the box. You can use the existing types in an immutable manner if you are careful, but I feel it would be better if you didn't have to.
I know solutions like seamless-immutable an help to deal with this, but it's still a little uncomfortable and you lose out on benefits like structural sharing unless you are using Immutable.js. Then you end up with a far heavier solution and a new API to remember.
Too Weak Typing
Even though JavaScript typing is great for prototyping, it begins to hurt you when you want to solidify your code. I believe it would benefit from a stronger type system or some kind of a compromise that would allow you to give the system some hints at least. Types are valuable information to me as a library/component author and I would prefer a hard failures fast than silent failures for my users to debug.
There's a lot of interest in typing as evidenced by the rise of solutions such as TypeScript and Flow. Maybe we'll see the same as with CoffeeScript and the standard will absorb the best ideas given enough time.
Conclusion
I think they took a nice step forward with ES6, but there's still work left to do. Actually instead of seeing more features I would love it if they started taking features away while solidifying the design. Dropping some old ideas, like defaulting to global variables by default, would be welcome as well. I know linters can do some of the related work, but standard is always the standard.