5 ms·
The web was originally created to share documents, so interactivity and extra functionality was an afterthought. As the web became more popular, websites starte
by LEDThereBeLight 4y ago
The web was originally created to share documents, so interactivity and extra functionality was an afterthought. As the web became more popular, websites started to add more functionality similar to traditional software programs.
Eventually, the original guideline of HTML for structure, CSS for styling, and JavaScript for interactivity started to not really make sense anymore for many websites, because as pages became more interactive, the lines became blurred. If you look at a site like GMail, where does the page structure end and interactivity begin?
With large parts of a page being interactive, it becomes difficult to manage all the state involved, especially if it’s a “live” page that updates in real time and may have several people viewing it.
Frameworks were introduced as a way to manage state and allow websites to re-render efficiently without hard page refreshes.
- skadamat 4y agoIMO this is the best answer. A clear, history-contextualized summary of the reasons why vanilla is often not enough for some use cases.
- krapp 4y agoFor some use cases, sure. But most sites aren't GMail. Frameworks and typescript should still be the exception, and the rule should still be independent, modular libraries like JQuery.
- kitsunesoba 4y agoAs someone who’s become most comfortable with strictly typed languages (primarily Swift and Kotlin), I find that TypeScript makes my dabbling in web dev much more tolerable and even somewhat enjoyable, even for simple projects with zero dependencies. Plain JS becomes frustrating quickly as project complexity ramps.
- joshmanders 4y ago> But most sites aren't GMail. Frameworks and typescript should still be the exception, and the rule should still be independent, modular libraries like JQuery. People always say this but it's so hollow. Most sites aren't Gmail, but we're not building most sites. We're building applications that work in similar fashion to Gmail, thus need similar stuff like all these frameworks provide. "Oh but everyone's using React to build their blogs instead of writing new posts for them and that's overkill" Let me stop you before we get to this point. People use their personal blogs as a way to test new concepts they want to learn, so of course it's gonna be over engineered to hell.
- neon_electro 4y agoSo what about when product management starts demanding even more interactivity on a marketing site built without React? I pushed back hard on introducing React when the site already had jQuery. Another developer said they could do what was needed with React. The marketing site started shipping both jQuery and React. I hate the JavaScript/React ecosystem so damn much for its complexity.
- joshmanders 4y agoYou hate a valuable ecosystem because your company product managers listened to someone else? I hope you find a new job. That's like saying you hate bananas because someone asked for a pie and you said you'd make an apple pie and they said they'd make a banana pie and they decided to choose the banana pie instead of your apple pie.
- klibertp 4y agoYou're being uncharitable for no good reason. If you're not sure if your interpretation of what GP said is true, ask for clarification and stop at that. Your first paragraph is ok, the second was uncalled for.
- joshmanders 4y agoUncalled for? I was explaining in a metaphor how I interpreted OP's reason for not liking React/JavaScript. I don't like PHP/Laravel ecosystem because I recommended we use vanilla PHP and my co-worker recommended we use Laravel and my manager decided to use Laravel. I don't like Python/Django ecosystem because I recommended we use vanilla Python and my co-worker recommended we use Django and my manager decided to use Django. Swap it with literally any framework in any language vs using vanilla-<lang here>. It all sounds just as ridiculous.
- deleted 4y ago[deleted]
- alpaca128 4y ago> typescript should still be the exception And JS shouldn't be exceptionally bad but here we are, and people use TypeScript as alternative to stay sane. I agree that modern web development comes with far too much complexity on average, but people started adopting those frameworks for a reason. The web is kept backwards compatible with obsolete standards which have been created in a different time for different purposes, and at some point it becomes easier to build abstractions over that. For example TailwindCSS adds another "compilation" step and configuration file but in return makes styling much more tolerable than standard CSS. Is it necessary? No, but when you build a large website all those little things add up.
- shadowgovt 4y agoAgree here. TypeScript is a bit of a Godsend even when using the vanilla DOM API because (a) the DOM API uses so many different abstraction patterns that it's easy to lose track of which one you're using (and passing the wrong arguments with no static typechecking is a runtime error) and (b) JavaScript itself has so much wat (https://www.destroyallsoftware.com/talks/wat https://www.destroyallsoftware.com/talks/wat) in its implicit value coercions that it's invaluable to have types narrowly-scoped in code so you have any hope of predicting what the output of operations will be.
- potatoz2 4y agoI don’t think JS is much worse than other dynamically typed languages to be honest. In Ruby you’d get an exception instead, which is mildly better than `NaN` in your user-visible text, but not much. The DOM though is definitely complex and built of accretion over time. The Web resists refactoring because we can’t break websites from the 90s.
- shadowgovt 4y ago> I don’t think JS is much worse than other dynamically typed languages to be honest. I agree; it's a plague all dynamically-typed languages face. I've yet to meet one that doesn't hit me with some kind of powerful pain-in-the-ass corner cases as a trade-off for the power of its terseness. I fell in and out of love with Python over the course of a decade or so. Initially very excited about doing so much with so little code; fell out of love when I used it in an industry setting and realized 100% unit test coverage was mandatory because the lack of variable declaration means every line of code is a potential runtime error in waiting due to a simple name typo.
- smm11 4y agoLots of hammers, when few actually need one.
- IYasha 4y ago> If you look at a site like GMail, Ouch! As a google mail theft victim, "right in the heart" :( > efficiently without hard page refreshes. And completely destroying the "Back-forward-refresh" functionality.
- at_a_remove 4y agoI think you've got the building blocks, but to really capture the "sometimes evolution is stupid" feel, you have to mention stuff like Javascript was created in ten days under some stupid deadline, with a stupid insistence that it have "Java" in the title. Or CSS being -- if not orthogonal to, at least wildly unparallel with -- against the grain of basic design principles like Contrast, Repetition, Alignment, and Proximity, then that awkwardness causing generations of table-based alignment solutions. And demands unforeseen, like piping video over HTTP. Take a step back for a second and think about that: we've got all of this stuff layered atop what was originally just a handful of specs on how to push barebones scientific papers around. Let's give a nod to Ports 80 and 443 uber alles, because of convenience, for video. And then the reaction -- well, how do we throttle this properly? We'll have to inspect, when before we just throttled the video ports for whatever video protocol we were working with. It's a history of one decision after another, made hastily, often in anger, and it's how we got ... here.
- twic 4y ago> Eventually, the original guideline of HTML for structure, CSS for styling, and JavaScript for interactivity started to not really make sense anymore for many websites My emphasis added. There are still absolutely tons of sites for which the classical model works fine, and indeed works better than React at al, because pages load faster and behave more normally. Some of those sites are now built with React et al anyway, for some bad reason (cargo culting, resumé-driven development, etc). But still, most are not, i suspect. Classical web development is still a very useful skill. However, i suspect that although a majority of web sites don't involve React et al, a majority of web development jobs do - because the fraction of sites that are complex enough to need React et al also need a lot more developers! (a fact i think is fun: a majority of stars are in binary or multiple star systems, even though such systems are a minority of star systems)