from Hacker News

Why JavaScript development is crazy

by afreak on 4/12/16, 4:57 PM with 4 comments

  • by spankalee on 4/12/16, 5:06 PM

    Web components do a lot to alleviate this problem. You get a basic reusable component model in the browser with no framework, and without requiring first jumping into the world of npm/bower.

    The vanilla JS example is barely longer with web components, and will be much easier to understand once it gets even mildly interesting:

        <html>
          <head>
            <script>
              class HelloWorld extends HTMLElement {
                constructor() {
                  this.attachShadow().innerHTML = '<h1>"Hello, world!"</h1>';
                }
              }
              customElements.defineElement('hello-world', HelloWorld);
            </script>
          </head>
          <body>
            <hello-world></hello-world>
          </body>
        </html>
  • by type0 on 4/13/16, 12:36 AM

    Besides overengineered apps, problem is that people start learning frameworks and libraries instead of learning how javascript itself works. They are so excited by the new tool/toy that they fail to realize that the same thing can be achieved in much simpler and more efficient way.