TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Why JavaScript development is crazy

35 pointsby afreakabout 9 years ago

2 comments

spankaleeabout 9 years ago
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&#x2F;bower.<p>The vanilla JS example is barely longer with web components, and will be much easier to understand once it gets even mildly interesting:<p><pre><code> &lt;html&gt; &lt;head&gt; &lt;script&gt; class HelloWorld extends HTMLElement { constructor() { this.attachShadow().innerHTML = &#x27;&lt;h1&gt;&quot;Hello, world!&quot;&lt;&#x2F;h1&gt;&#x27;; } } customElements.defineElement(&#x27;hello-world&#x27;, HelloWorld); &lt;&#x2F;script&gt; &lt;&#x2F;head&gt; &lt;body&gt; &lt;hello-world&gt;&lt;&#x2F;hello-world&gt; &lt;&#x2F;body&gt; &lt;&#x2F;html&gt;</code></pre>
type0about 9 years ago
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&#x2F;toy that they fail to realize that the same thing can be achieved in much simpler and more efficient way.
评论 #11485965 未加载