Live data from Hacker News

Why is front-end development so unstable? (2018)

breck-mckye.com

121–130 of 181 posts

Re: Why is front-end development so unstable? (2018)

#121

Earlier quoted context omitted.

Asking sincerely because this take is surprising to me: which specs are you referring to? From my perspective—started front end, gradually went full stack, spent several years fully back end, dove back in a couple years ago—quite a lot of the APIs introduced in the period I was fully back end (and since) are excellent and vastly improve both development experience and the ability to deliver a better user experience.…

> Asking sincerely because this take is surprising to me: which specs are you referring to? I'd like to see the Web Components spec revisited: it has a) no API for passing non-string attributes to other web components, b) no API for declaratively updating your DOM subtree - you either do manual surgical DOM changes, or blow away your (potentially stateful) children and recreate them. Without these, the raw web compon…

I haven’t worked with web components, and have only had a passing interest generally. But oddly enough I took some time today to dive deeper. It occurred to me that some of the APIs would potentially benefit some work I’m doing in a legacy project. I’m not an expert on the topic, but I have a few thoughts.

First, I agree both of these limitations make the spec less directly useful than a framework, and more likely to be APIs targeted by a framework (however formal or bespoke). That said, that’s pretty much the guiding design philosophy behind nearly all DOM APIs, and it doesn’t seem to me that makes anything worse, just incomplete. I suspect that richer APIs would make things worse. People would still use frameworks, but those frameworks would have to use much more opinionated and much less flexible APIs at a higher level of abstraction. All of that said,

> no API for passing non-string attributes to other web components

This is really a limit of HTML, and not new. But there’s plenty of precedent for raw string attributes to have a more meaningful representation in the DOM state. An area of the spec that seems really well suited to accommodate this is `part`[1]. Like `classList`, it’s a `DOMTokenList`, and has a corresponding CSS selector. It’s a string attribute, but it’s also structured data as a property. I have a long list of things I’m confident will benefit from this.

> no API for declaratively updating your DOM subtree - you either do manual surgical DOM changes, or blow away your (potentially stateful) children and recreate them.

This really is a footgun, but I’m not sure what the appropriate alternative is. I don’t think any spec could accommodate the fact that people choose different declarative implementations for very different use cases, without essentially defining high level interfaces that expect to be overridden. Even then, those interfaces would almost certainly be ill-suited to some specialization or another. If your goal was purely creation, I’d agree that there should be a declarative API. But for updates? I can’t imagine a design which wouldn't be worse.

> Without these, the raw web components API isn't suitable as an alternative to React et al. You've got to build a whole framework around them (like Lit), and at that point you're just using another framework.

I don’t think the goal of any of these APIs should be to replace frameworks. At that point you’re just using a framework forever. It’s an enormous credit to the design behind all of these APIs and their overlapping specs that they continue to produce useful lower-level interfaces without overly steering the ship.

1: https://developer.mozilla.org/en-US/docs/Web/API/Element/par...

Re: Why is front-end development so unstable? (2018)

#122
post #117

Earlier quoted context omitted.

If you don't know these words you haven't been coding JS long enough. Those like myself who started in 2014 or earlier know all of those and more (anyone still remember shrinkwrap for example)?

Depends HOW you coded. I started JS at 11 yo in 2001, and became fulltime around 2012 - 2 more years of JS than you, I'm your grandaddy in this ever changing mess... I do not know Broccoli either. Googling it: "A fast, reliable asset pipeline, supporting constant-time rebuilds and compact build definitions" I raise my eyes to the ceiling and whine "why the hell isn't there an Oracle or IBM for JS to finally standardi…

Very, very few places will let you not use a framework nowadays. There is a ton of cargo culting around JS frameworks and coding vanilla is pretty much heresy land these days. Personal projects? Go for it. Commercial apps built for your employer? Good luck with that. Not only will you be raked over the coals for "reinventing the wheel" you'll also be blamed for any stumble along the way, whether it's related to using vanilla or not.

> if you want some war stories from your granddad, have you heard of jQuery ? :D

Bah, whippernsapper! I cut my baby web teeth on CGI and spent the bulk of it in Struts and JSF. Remember THOSE?

Re: Why is front-end development so unstable? (2018)

#123
post #118
post #113

Earlier quoted context omitted.

I've used the same React tech as the basis for most projects for 6 years now. Webpack, Redux, Yarn, React Router, all still popular and maintained. We even used hooks for functional components since then, through the "recompose" library, so there wasn't a big paradigm shift for us. Anyone who feels compelled to jump from one unproven state management library or bundler to another, in serious projects, is just not doi…

> I've used the same React tech as the basis for most projects for 6 years now. Webpack, Redux, Yarn, React Router, all still popular and maintained. We even used hooks for functional components since then, through the "recompose" library, so there wasn't a big paradigm shift for us. Have you worked at different companies or contributed to different OSS projects in those 6 years? If you have, and they've all been set…

Yes to both, and I can't say many projects followed a radically different approach, at least without good reason. Webpack and Redux for example are many times more common than something like Parcel or Jotai, so it's rare to encounter many of these alternatives in one project.

Re: Why is front-end development so unstable? (2018)

#124

I'm the author of this piece. I no longer think front-end suffers the instability people accuse it of. I think there are a lot of _vendors_ trying to usher in a revolution around their particular products - there's a lot of VC funding in JavaScript tooling nowadays - but that's a different problem.

You covered the frameworks, but a lot of the feeling comes from the tooling and library ecosystem. For example, a recap of the last 10 years: - grunt / broccoli / gulp / browserify / webpack / metro / esbuild / parcel / swc / turborepo / bun - flummox / redux / unstated / mobx / mobx-state-tree / xstate / apollo / apollo-link-state / swr / react-query / zustand / recoil / jotai And this is just within React, and off…

Postgres, mysql, mariadb, cockroachdb, Prometheus, neo4j, firebase, dbaas. The list goes on and on.

Multiple things exist. That’s fine and healthy? You don’t need to know absolutely everything.

Re: Why is front-end development so unstable? (2018)

#125

Earlier quoted context omitted.

You covered the frameworks, but a lot of the feeling comes from the tooling and library ecosystem. For example, a recap of the last 10 years: - grunt / broccoli / gulp / browserify / webpack / metro / esbuild / parcel / swc / turborepo / bun - flummox / redux / unstated / mobx / mobx-state-tree / xstate / apollo / apollo-link-state / swr / react-query / zustand / recoil / jotai And this is just within React, and off…

Postgres, mysql, mariadb, cockroachdb, Prometheus, neo4j, firebase, dbaas. The list goes on and on. Multiple things exist. That’s fine and healthy? You don’t need to know absolutely everything.

There's people out there who chose PostgreSQL twenty five years ago and found out since to have made the right choice. Not sure if that can be said of any item on the list you were responding to.

Re: Why is front-end development so unstable? (2018)

#126
Changing APIs. When the front-end gets JSON from an API. We really don't know what we're getting. We need to liaise with the API team to figure out how these APIs work and when they change, we don't know what changed. Luckily there is a new solution. End to end type safety. Using tools like graphQL allows FED build tools to get the entire API schema and bring that into the typescript build. If the API changes, your build will break allowing you to update your app to the latest API.

Maybe we need a new HTTP method "SCHEMA" that allows the app team to get the schema directly from the API and stop sharing postman links around in chats.

Re: Why is front-end development so unstable? (2018)

#127

Earlier quoted context omitted.

You covered the frameworks, but a lot of the feeling comes from the tooling and library ecosystem. For example, a recap of the last 10 years: - grunt / broccoli / gulp / browserify / webpack / metro / esbuild / parcel / swc / turborepo / bun - flummox / redux / unstated / mobx / mobx-state-tree / xstate / apollo / apollo-link-state / swr / react-query / zustand / recoil / jotai And this is just within React, and off…

It’s true that there are a lot of different ways to do the same thing, but the good news is you’re doing the same thing and the difference is mostly just syntax. Someone who has used Redux extensively can get up and running with Zustand in no time, and vice versa. Likewise React Query and Apollo Client are basically the same thing. Build tools are a bigger issue, but fortunately most front end devs don’t actually nee…

As if it's so easy to move from one thing to another. Yikes!

Re: Why is front-end development so unstable? (2018)

#128
the last good ideas in js land were react and google’s closure compiler.

reagent[1], a react wrapper, has had a stable and tiny api for a decade.

easy, fun, and effective sdlc[2] on mature technology is easier now than ever.

there are no more excuses.

1. https://reagent-project.github.io/

2. https://github.com/nathants/new-gocljs

Re: Why is front-end development so unstable? (2018)

#129
post #5

UI/UX is a fundamentally flawed field for a number of intersecting reasons, most of which boil down to not really distinguishing between when it's doing engineering, when it's doing psychology, and when it's doing fashion. And these days, on web apps and mobile apps, it mostly does fashion. Fashion must change for the sake of change. To more easily support these frequent changes, more libraries get invented to make d…

90% of UI/UX people could disappear overnight and nothing would change. Things might actually get better because they aren't doing a pointless UI overhaul every 6 months.

Re: Why is front-end development so unstable? (2018)

#130
post #126

Changing APIs. When the front-end gets JSON from an API. We really don't know what we're getting. We need to liaise with the API team to figure out how these APIs work and when they change, we don't know what changed. Luckily there is a new solution. End to end type safety. Using tools like graphQL allows FED build tools to get the entire API schema and bring that into the typescript build. If the API changes, your b…

This comment makes absolutely no sense in the context of the article. Did you read it?
Post reply on HN