4 ms·
If you need minimal js, there's no need to use frameworks. I don't understand why we came to think the opposite, but you absolutely don't need state managing, e
by curtisblaine 2y ago
If you need minimal js, there's no need to use frameworks. I don't understand why we came to think the opposite, but you absolutely don't need state managing, effects and a build chain if your goal is to merely show some content on the web.
If you need to write a web application, on the other hand, you absolutely need all these things, because your mutable state will become a mess after a short while, your event handlers will call your components in a thousand tangled ways and you will want to navigate your code and your types using your IDE. But, again, if you just want to show content with minimal javascript, you don't need to worry about that. Leave all that stuff to web application developers, instead of looking at that stuff, concluding it's too complex for you and ranting against it on the Internet. It's not made to solve your problem.
- austin-cheney 2y ago> I don't understand why we came to think the opposite The DOM is scary.
- curtisblaine 2y agoIt is, and, worse, it's mutable. But nobody needs to manipulate it just to put some content on the Web.
- austin-cheney 2y agoYes. 80% of a modern frontend developer is just putting text on screen. All the steps and frameworks involved just tend to be resume padding. That’s unfortunate because back in the day when I started doing this work frontend developers were expected to do more than this.
- krapp 2y agoChildren learned how to use it in the 90s from basic web tutorials and reading source code, it isn't that scary. The real reason is that the web started to become serious business, and that meant javascript had to become a serious language, which led to all of the nonsense it accreted over the years from startups and enterprise. Everyone uses frameworks and compilers and a package manager because a serious language uses frameworks and compilers and a package manager, and all of these look good on a resume.
- curtisblaine 2y agoHave you tried to write a really complex web app without router, state manager, type completion and declarative DOM? And no bundling, so you have tens of <script> tags in the right dependency order to support older browsers? It becomes quite fragile very soon. But the good news is: you can do without all this. You can manipulate your mutable DOM manually, send and receive messages via native DOM events and mutate your state inside a big vanilla object. You can do without tooling, just Notepad or Vi and a browser. You don't even have to need type completion. You don't even need const or Promise, you can use var and callbacks, everything is still there. If you think tooling is startup-fueled scam (and probably some of it is), there's literally nobody in the world to force you use tooling. The web is entirely backwards compatible, you can do whatever you think is best!
- krapp 2y ago>Have you tried to write a really complex web app without router, state manager, type completion and declarative DOM? No, but only because I used other backend languages and frameworks for that, because there are much better languages suited to those tasks than JS. Especially in the browser. SPAs exist to serve a specific business case, they aren't qualitatively better than what came before. >And no bundling, so you have tens of <script> tags in the right dependency order to support older browsers? It becomes quite fragile very soon. Or just use JQuery and some modules. You make it seem way more complicated than it was, it was never that complicated. It was never nearly as complicated as the current JS ecosystem. Talking about "tens of scripts" when the current status quo is a brittle dependency tree of hundreds, if not thousands, of scripts for even the simplest task is silly. >The web is entirely backwards compatible, you can do whatever you think is best! Yes. This is technically true, but unfortunately tech culture has years of ingrained social pressure leading people to believe javascript is a dangerous language that they don't dare approach without ten layers of abstraction protecting them, and the nonexistent business value in doing so, because the ecosystem is dominated by capitalists. The fact that "vanilla js" even exists as a term demonstrates how pernicious this fear has become - there is no "vanilla x" any other language. Only javascript needs a special term for just using the language because of the deep cultural taboo against doing so.
- Chance-Device 2y agoThe problem is not that the tools exist, or that complexity exists. The problem is that the community view, enforced by various incentives and supported by the creators of these tools, creates a situation where technology choices are driven by what sounds good or is trendy rather than solving the problem at hand in the most effective way. Technology choices are institutional decisions. They are reached largely via defensibility to non-technologists, to whom (and indeed to most technologists) boils down to appeals to authority rather than to reason. Nobody is trying to stop this, and indeed many are trying to increase it so they can sell products with more features that virtually none of their customers need. Blogs, influencers and educational platforms push what is new so that they have more content. All of this is self reinforcing and we suffer because of it.