
JavaScript cannot be fixed - horrido
https://medium.com/@richardeng/as-others-have-noted-the-fundamental-problem-with-web-development-is-that-javascript-is-a-broken-7f9675048c77
======
alexkavon
Absolutely agree. I was looking at this exact same thing last week. From what
I'm come to understand from the overly bureaucratical responses I received
from JavaScript community members, is that the language is designed with two
intentions in mind:

1\. Never break legacy code. 2\. Be an open adaptable language that any
developer from any background (or no background) can write code in.

It's a messy messy attempt at being the popular kid. For example, classes, a
popular new feature of ES6 looks like this:

~~~

class Hello {

    
    
      constructor(name) {
        this.name = name
      }
    
      hello() {
        return 'Hello ' + this.name + '!'
      }

}

~~~

Cool. However in ES5, this is how a class is created:

~~~

function Hello(name) { this.name = name }

Hello.prototype.hello = function hello() { return 'Hello ' \+ this.name + '!'
}

~~~

Okay...this makes sense and while the ES6 version is syntactically cleaner, it
breaks the paradigm set in ES5. Knowing what I know of other languages, I'd
expect something like this:

~~~

class Hello {

    
    
      function constructor(name) {
        this.name = name
      }
    
      function hello() {
        return 'Hello ' + this.name + '!'
      }

}

~~~

I was told the reason is that methods are not functions. Which is an okay
reason, but wait, they are functions in ES5...

Furthermore, you can't use ES6 class syntax in non strict mode. At first I
assumed a valiant attempt of deprecating older features, by requiring a strict
mode as a sort of psuedo deprecation. However what stinks about this is that
it still doesn't fix the issue 100%. There are already too many tutorials out
there describing how to write bad JS code. What ultimately needs to happen, is
that browsers, nodejs, etc, need to always operate with strict parsing. The
"use strict" flag is too easily forgotten. Yes this will break programs that
are 50 years old, but everything has to come to a halt eventually. Another
solution would be to "fork" or start a new language from scratch to replace
it. I'm aware this is the intention of Dart, however it's adoption rate seems
too little to make an impact as evidence by it's lack of care to be included
in Chrome even ([https://www.dartlang.org/support/faq.html#q-will-the-dart-
vm...](https://www.dartlang.org/support/faq.html#q-will-the-dart-vm-get-into-
chrome)).

