Top
Best
New

Posted by vinhnx 18 hours ago

Why don't more developers “use the platform”?(nolanlawson.com)
268 points | 272 commentspage 2
wuhhh 13 hours ago|
Many native web browser capabilities exist because adventurous developers came up with the patterns themselves. There is no way we’d have CSS scroll-driven animations available to us if front end developers hadn’t already established the requirement and pattern. Browser standards, CSS specs etc follow what _we_ hack together and make ubiquitous (sort of like desire paths), not the other way around. That is why we shouldn’t blindly “use the platform”; vendors should adjust to our demands, not the other way around. Of course, if a native element or capability matches exactly your requirements in some scenario, using it would be sensible.
atoav 13 hours ago||
I always try to make HTML and CSS do the main work, while using HTML semantically. JS sprinkled on top where HTML/CSS won't perform the desired function (has gotten less over the years). And obviously server-side code where such a thing is needed.

But if I can get away with a static website that uses just HTML and CSS that is the baseline. And it has served me very well and produced very low (=zero) maintenance results.

bcjdjsndon 12 hours ago||
The insane double think of web dev...

They want the benefits of a browser with the capabilities of native code. At some point you have to ask yourself would it not just be easier to do this in a normal programming language.

edukite 8 hours ago||
I was early adopter of WebComponents and honestly they are terrible. If only they would have at least CSS layer which would be passed and I can reset styles and shadow root would be accessible ass private property and every element with id world be accessible through private property so I don't need to store them in weird way of query them.

Then I would consider them acceptable

In current state they are unusable beyond simple components

danfritz 10 hours ago||
Ever used a time field in pure html? And then you get reports users can enter 99 minutes.

Yes that's why

padjo 10 hours ago|
This is the answer. I have a strong bias towards using the platform but very often you just can't because the platform has weird edge cases or inconsistent behaviour across browsers.
sebastiangrill 15 hours ago||
I think this is completely wrong. The reason why nkt a lot of people use the built in elements is because sooner or later you will hit a limitation that you cannot fix. If it is a javascript element you can do whatever you want if it doesn'fit.

Take dialog as an example. If you have a server side rendered app and you want to show an open dialog without js. You are out of luck, you can't just render it as open because that opens a dialog that does not correctly work. Or take a multiselect input. Just unusable as a normal browser element. Also most elements miss something essential like no search function in an input. So also unusable for big lists. I could make a list of 100 things that are wrong with native browser elements. It is just easier to use a js framework/library and have a clean view and state.

rtpg 14 hours ago||
This issue remains true even with the JS "wrapper" elements.

The number of times I have senen frontend people pull in some frontend component from a library (say, for fancy select widgets) and then have to spend a bunch of time trying to fight the existing bugs in that... and then struggle to swap it out later on for another library with a distinct set of bugs...

UI is hard, so it's hard to have a general thing fit _your_ specific purposes nicely. This is why I think it's super valuable to wrap things you can't control easily. That way you both document what you _do_ use, can fix issues at a bit of a higher level, and can swap out the internals way more easily.

People fight back on me on this on so many projects (the most recent thing: "the LLM won't know about our special UI component" IT WILL! IT CAN READ THE CODE!), but then hit those moments of regrets and end up wrapping stuff anyways.

Especially annoying coming from people who talk about design systems. A base vocabulary is a real good way of enforcing a design system!

I mean this relatively lightly, I understand the qualms at a high level, and coming up with the right abstraction is a skill. I've just felt the burn too many times and have very little issue coming up with very limited abstractractions and relying on tech debt to get my wrapper components out into the world.

sebastiangrill 14 hours ago||
I agree. Still better than the native elements. The biggest downside is 100kb js elements because they try to handle everything. I used basecoat and that worked ok, even if some essentials are missing. Currently I am using my own webcomponents created with rocket (from datastar)
maccard 13 hours ago||
I disagree it’s better than the native elements. At least the native elements work reliably rather than just on whatever version of chrome the custom one happened to be tested on
makeitdouble 14 hours ago|||
> It is just easier to use a js framework/library and have a clean view and state.

To note, it's "easier" if you don't really care outside of your specific and limited case.

Multi select is a perfect example: if you only ever need that component to work in your language on your specific list for the browser you personally use for the screen sizes you care about, it will be pretty easy.

Hell starts when you try to think beyond that: how does the JS component work in responsive for super small screens and super big screens ? do you handle touch and mouse and stuff in-between ? what about CJK ? Right to Left ? do you care if there is any very long entries in the list ? How do you handle previous selections ?

The more you start to care about the details or expand the range of what you're doing, the more you'll be pulling hairs if you try to handle them.

The native components won't be perfect either. Native devs will also be dwelling in that same hell as you, whether or not the native state is better will depend on how much they cared on their side.

maccard 13 hours ago|||
> because sooner or later you will hit a limitation that you cannot fix. If it is a javascript element you can do whatever you want if it doesn'fit.

This is a crutch that people lean on to not use the right thing and use what they’re familiar with. Start with the browser default and change when it doesn’t work in that case.

hobofan 12 hours ago|||
When you tried to do that a few dozen times, and the outcome is always to build (and have to rebuild!) off platform, starting out off platform is the logical option.
charcircuit 12 hours ago|||
Why should a developer learn 2 ways to do something when they could just learn 1. You are not improving the developer experience of the web by dictating that people have to learn 2. Either you make the native one capable enough to handle everything or you accept that people should just learn a javascript one that is capable of everything.
hnedeotes 9 hours ago||
Yeah, the dialog thing is extremely annoying... I use them, and I always have to have a work-around for when morphdom replaces the dom nodes of a dialog because it will just make it disappear ... `non-programmatic-open=true` would solve it - yes, it can have edge cases but then it's a matter of me programming correctly, instead of programming work-arounds every time I need it.
flippingheck 15 hours ago||
When a technology becomes popular enough, it develops a community that solidifies that choice: conferences, books, extensions, a generation of engineers that see things in terms of React.

A technology needs to be a lot better to overcome that aspect.

Sometimes I visit a subreddit for a tech and see them all discussing strategies/techniques that are ultimately workarounds for what an alternative technology has fundamentally solved, but... the original tech has an army of volunteers able to help newbies workaround it, which is often an easier onboard experience than the alternative tech that just works, but doesn't have any advocating solutions/blog posts because there are no blog posts to be written.

jchw 15 hours ago|
Counterpoint: the problem was solved by an alternative, but was it solved without any tradeoffs? If the solution comes with no real tradeoffs, then that begs the question why React wouldn't simply adopt the solution... And I think this is not a theoretical nitpick, either: Angular actually has, to my knowledge, basically done this more than once. And React certainly doesn't seem afraid to make big or breaking changes, from fibers to suspense to hooks to context, so I don't think it is resistance to change at play here.

I think when you consider that the solutions sometimes may come with tradeoffs that cause problems that people like less than simply working around the first problem, it makes a lot more sense.

I don't think conferences, hype, corporate backing explain the continued success of React; they help but it's just not the full story. I don't think they explain the continued success of anything else, either; I find this to be a shallow and lazy dismissal in most cases. It's easy enough to find counter examples where none of these things, not conferences, hype, corporate backing, or whatever else you could think of, were enough to make something work. While these things definitely help keep something relevant, they can't do it alone.

In fact, in attempting to rationalize the success of React without acknowledging its strengths, I believe people have fundamentally reversed cause and effect. I think a lot of the continued success of React comes from people continuing to choose its set of tradeoffs over others even when they could tolerate risk. I think that conferences continue to be organized and books continue to be written because of its continued success.

The tech community on the Internet has largely matured enough to acknowledge why PHP was and is successful; yes, there are many objective issues with it even today, but it also has many strengths beyond just having existed for a long time, too. Do I think you should choose PHP for new projects, the way I might say for React? Well, no, not really, if I'm being honest. But, I think it was nice to see people grow up and acknowledge that actually, there were and are a lot of redeeming qualities to PHP, and what it did for a lot of people was pretty cool, fractals of bad design be damned. It'd be a shame to see this repeated again more for stuff like React and say, Go, just because it's not the dog in the race we wanted to see win. (And I would understand that position, because I fully understand why people like Svelte, or Rust. I just don't think there is a conspiracy, it's just that there isn't a free lunch here.)

Izkata 3 hours ago|||
> And React certainly doesn't seem afraid to make big or breaking changes, from fibers to suspense to hooks to context, so I don't think it is resistance to change at play here.

As far as I know React hasn't had any such breaking changes. Those were all added on top without removing anything. Class components without hooks still work fine, for example.

jchw 31 minutes ago||
As a very long time React user, React.createClass is certainly gone. So are some old versions of the context API. Although it never broke any of the guaranteed behavior, Fibers broke a lot of behaviors that were not guaranteed. Upgrading the major React version in any very large application is likely to cause at least some issue to shake out.

I think the more correct thing to say, at least in my opinion, is that React never breaks functionality without good reason. If you are following the React best practices and not relying on unintentional implementation details, using hooks/lifecycles/APIs correctly, your application will not break for a very long time.

If there was a sufficiently good innovation that was a pure win with no downsides, I believe the React devs would do their best to integrate it in a minimally disruptive way... But just like the adoption of ES classes, I do expect that eventually they will drop support for "the old way" when the time comes.

flippingheck 14 hours ago|||
I think we agree, though I can see why it might not have seemed that way, since I didn't draw attention that users might rightly conclude the overall tradeoff is worth it, even if another tech is sounder in some minor aspect.

React can adapt, and though Web Components might still have some claim on X, Y, Z, React still is heavily preferred because all the other things are so much more important to developers.

For what genuine gaps remain, there's lots of React users that can help others through it.

nonethewiser 18 hours ago||
An aside: This name an logo are incredible. https://bevacqua.github.io/dragula/
eptcyka 15 hours ago||
An aside: drag and drop doesn’t work on iOS Safari well at all - dragging also pans the viewport.
sodapopcan 18 hours ago||
I actually still use Dragula. I can't quite put my finger on it, but it just feels better than Sortable. I may be imagining it, but I also don't care because, you know, it's just a JS library.
onion2k 17 hours ago||
The last couple of websites I've made have been largely the output of Claude with some instructions to keep to WCAG AAA accessibility standards and to optimize for loading and rendering times, and it's done a pretty decent job. If you're insistent about page weight it will avoid adding JS and React and use to browser-native elements, CSS, and vanilla JS where it can.

I think the problem is that you have to ask, and to know the language to get the result you're after. If you just ask for a pretty website you're getting 800KB of React libraries to render something, and all in AI Beige with Inter as your font choice.

user43928 15 hours ago|
Do you really need to know the language or is it enough to bother asking about improving the loading time or customizing the look?
ben_w 5 hours ago||
You need to know.

Here's an isochrone map renderer I got Claude to make: https://benwheatley.github.io/Isochrone/web/?region=berlin&s...

One of the failure modes was it running out of GPU RAM because it tried to allocate (multiple!) pixel buffers on a m-pixels-per-n-real-world-meters basis(!), and repeatedly didn't see the problem with this despite it being a vector graph on a normal screen.

I only even noticed this bug due to another bug where it got the bounding box for Portsmouth badly wrong by including the entire length of the ferry routes to France.

If I didn't understand how to use the JS console, it would have been stuck saying "I can't reproduce the problem"; and if I didn't understand the way computer graphics work I wouldn't have been able to recognise that multi-gigabyte pixel buffers are not normal, nor would I have been able to recognise that in this case those particular buffers were totally redundant.

qurren 17 hours ago||
Because the platform sucks. I want a rounded button with a certain radius and a certain font, that feels squishy and satisfying when you press it, especially on mobile.
xigoi 12 hours ago|
What do you mean by “squishy and satisfying”? Otherwise it’s easy.
amelius 13 hours ago|
The main reason is flexibility.

One day your boss stands next to you and asks: "can you move this border three pixels to the left", and the only correct answer is "but that requires a complete rewrite".

murkt 12 hours ago|
One can also ask why that is needed and how it will make product better. Is that the highest priority to move a border three pixels to the left?
amelius 12 hours ago|||
Well, people caught in the Apple universe seem to be capable of going pretty berserk about a few pixels left or right.

I don't think anyone was ever able to talk reason into them.

bcjdjsndon 12 hours ago|||
Just do what you're paid to do codemonkey and stop arguing
amelius 12 hours ago||
That's no way to talk to people, even in the AI age.
More comments...