Live data from Hacker News

Why Is the Front End Stack So Complicated?

matt-rickard.com

31–40 of 69 posts

Re: Why Is the Front End Stack So Complicated?

#31
A somewhat sobering post explaining the background behind all this complexity. It is very easy to rant against complexity on its own, but respecting the background that lead to it - that requires nuance, history and a bit more words.

That said, one of the major problems is that there is no clear explanation for these boundaries in the tooling and code. Yes, you can `npm install lib` and unless it is documented in readme, it won't be obvious will this run in node only or in web too.

Re: Why Is the Front End Stack So Complicated?

#35

I guess it starts by abusing a document system to develop interactive applications instead of using an actual application SDK.

That just explains why do we know about that complexity. Alternatives aren't less complex (and when you need some niche features W3 supports like printers and BT you're in deps hell -- at least you're operating without node.js), but data flows more linearly from server to client.

Re: Why Is the Front End Stack So Complicated?

#36
post #8

I guess it starts by abusing a document system to develop interactive applications instead of using an actual application SDK.

This is the entire reason. HTML, JS, and CSS weren't designed for their current purpose and updating them requires slow coordination across browser developers. Once you start using compile-to-JS and get out of the JS ecosystem mess, the developer experience suddenly feels much less complicated.

What specific compile-to-JS ecosystem do you have in mind? I don't think I've encountered one that doesn't add complexity and layers of indirection. It may be worth it, but it doesn't come for free.

The easiest approach I've ever worked with is vanilla JS. But of course, building complicated stateful apps without a view layer like React is its own complication.

Re: Why Is the Front End Stack So Complicated?

#37
post #35

I guess it starts by abusing a document system to develop interactive applications instead of using an actual application SDK.

That just explains why do we know about that complexity. Alternatives aren't less complex (and when you need some niche features W3 supports like printers and BT you're in deps hell -- at least you're operating without node.js), but data flows more linearly from server to client.

I find native application SDKs like Cocoa on macOS certainly less complex for the same functionality.

E.g. supporting printers there is just no issue. But maybe I misunderstood what you meant.

Re: Why Is the Front End Stack So Complicated?

#38

It is rather simple why: Frontend is not linear programming, most backend actions are single-flow (on A do B), in frontend at any point the user can interrupt things, which calls for state management. Most backend applications are stateless and state management is outsourced to a database which does the heavy lifting. So the complexities are in scaling. Maintaining a complex frontend application is akin to maintainin…

Yeah - it’s a wildly different paradigm. It’s not quite the same as Erlang/OTP, but it requires a mindset shift much like learning OTP and thinking of callbacks on an event loop working together. Users can interrupt code when they want, and aren’t obligated to take a blessed path of actions.

I will say that some of the complications he mentions are from web apps needing to compile down to a single executable, on a platform that only really supports one interpreted language. Perhaps WASM will help here, over time.

Re: Why Is the Front End Stack So Complicated?

#39
The reliance on nodejs which lacks a standard library. It lacks a built in build process. It lacks a built in lint/format process. It lacks a built in test runner (although I believe this isn’t true anymore?). It did have a module import process, but it was so badly implemented (or maybe it lacked it in the beginning?) that despite nodeJS being the standard, most people are still using require JS.

I don’t know which, if any, nodejs alternative will succeed it, but if say Deno were to do so, the stack would be immeasurably simpler.

Right now, hopping between 2 different JS projects both of which do the exact same thing, means you may have to learn completely different build processes, completely different minting rules, completely different typescript compilers, completely different module import syntaxes/formats/configurations, completely different test runners, test description languages, etc. completely different standard libs (one may have lodash while the other is importing individual functions from npm), etc.

Heck, even your nodejs may not be nodejs but rather could be yarn, pnpm, etc

I believe nodeJS’s decision to essentially outsource all basic functionality while the JS ecosystem figured itself out was a huge reason for its success, but now that many things are more established, it’s causing a lot of unnecessary complexity.

Re: Why Is the Front End Stack So Complicated?

#40

It is rather simple why: Frontend is not linear programming, most backend actions are single-flow (on A do B), in frontend at any point the user can interrupt things, which calls for state management. Most backend applications are stateless and state management is outsourced to a database which does the heavy lifting. So the complexities are in scaling. Maintaining a complex frontend application is akin to maintainin…

Another wrinkle - lots of web apps have a need to say, I’m going to give you one bundle of JS for this whole hostname, regardless of URL, but then have to handle getting loaded from arbitrary URLs (that may have semantic meaning for your server) anyways. Everyone gets the complexity of a URL document hierarchy, even if your web app isn’t document-based.
Post reply on HN