8 ms·
It's genuinely fascinating to me how many professional web developers these days - smart people who produce good work - don't know how to build interactive feat
by simonw 2y ago
It's genuinely fascinating to me how many professional web developers these days - smart people who produce good work - don't know how to build interactive features using HTML on its own (and maybe don't even know it's possible).
Being able to do things like this is really useful:
<form action="https://simonwillison.net/search/" method="get">
<input type="text" name="q">
<input type="submit" value="Search">
</form>
I've seen teams estimate a full day to add a link to a contact form because they need to refactor a bunch of React components to achieve that. I like being able to do this:
<a href="/contact">Contact us</a>
- jetbalsa 2y agoI'm love old school HTML, need a autoscaling page, lets break out some FRAMESETs and some tables/iframes
- amelius 2y agoIt's because submitting a form interferes with all the other stuff running on the same page. E.g. after submission animations stop or disappear or skip a frame, annoying designers, etc. etc.
- moron4hire 2y agoI don't think there is really anything in your "etc. etc." I have never heard from any real user a complaint about animations stopping mid-flow. I think people know how pages work, in that I think they expect clicking things to do something disruptive, altering, changing. It's only been the design astronauts that have argued these discontinuities are "confusing" to users. If anything, sometimes I think they make the transition too smooth, to the point that it can be possible to miss it. Sharp changes are generally easy to notice.
- amelius 2y ago> I don't think there is really anything in your "etc. etc." "etc. etc." = anything with state, so this can be quite a lot actually ...
- BiteCode_dev 2y agoHTMX. Or worst case scenario, fetch(). But honestly, forms are fine. Not all apps need beautiful animations. It's better to have great UI, but it's not free.
- andrei_says_ 2y agoHTTPS://gov.uk is amazing.
- jmathai 2y agoIt's not always the right tool but in more cases than modern devs believe, it is. I've built several web applications recently that don't use any modern JavaScript framework. You'd be surprised how quickly a page can fully reload and equally surprised at how okay of a UX it is to not always persist state. Here's an example video of an app that does a mix of "state persistence" and "good ol' reload the page" approaches. https://withlattice.com/documentation#nav-create-application https://withlattice.com/documentation#nav-create-application 1) Chat interface maintains state (but uses minimal JavaScript) 2) Application status requires a reload Is this the absolute best UX? Possibly not, but users haven't said anything about it and it's such little code with almost zero dependencies.
- edoceo 2y agoNobody complaining isn't necessarily a "good thing". Absence of evidence and all that. I've found that it's only like 1/1000 that will. And this thread (few days ago) about why it's hard to buy nice things touches it https://news.ycombinator.com/item?id=42430450 https://news.ycombinator.com/item?id=42430450 Many (most?) don't raise issues because they've been conditioned that things won't get fixed. I'm with you that overdone JS isn't necessary; and we should also consider user-silence to issues to bloat, slowness and jank.
- jmathai 2y agoI agree with all of that. Perhaps what I meant to say was that these weren't the things users were complaining about. I love a beautiful UI and experience. Listen to users and prioritize what helps them.
- oblio 2y agoForms are the real problem, not the tons of ads, auto playing videos, notification pop-ups, etc :-p
- imetatroll 2y agoThe sites that genuinely need a react frontend are fewer than the sites that use a react frontend. If you forgo react from the start, you have simplicity. At most, track your "state" in a session cookie + "rendering" on the backend. The good old days. I miss them.
- geoffeg 2y agoI worked with a team of developers tasked with creating a few 100% static websites. Single page, no interactivity, nothing dynamic. They were talking about which React components to use, server APIs to build, etc when I asked why they didn't just write HTML or use a static site generator and host the page in S3. They didn't know how to write vanilla HTML, they had never used it for more than bootstrapping a React app.
- amelius 2y agoYes, but remember: static HTML is a one-way street. Better tell your manager otherwise they will one day come up with functionality that can't be done in your website and it's your fault. EDIT: For example: manager/designer wants to add an assistant to the website; it should be draggable; it should also animate and keep animating smoothly no matter where the user navigates on the website. If your website is a SPA, this is conceptually easy. If your website is static this is going to be a nightmare and suddenly a simple change requires lots of work.
- epistasis 2y agoYou can't add interactivity to a static HTML site? Or shift the static pages into modern frameworks?
- willsmith72 2y agoI mean let's not go too far and pretend there is 0 advantage to JS
- frostiness 2y agoYou absolutely can, but it's way more common to only know how to create a blank site with a framework than to migrate an existing site. React used to have a section in its documentation for how to add it to your site without adding a build system (not common knowledge, unless it's setting up a blank site through a script) and they've since replaced it with a brief tutorial telling you to migrate your website to a JS module with a link to a suggested build system. All of this matters because the person that has to do this setup might not be you. It's certainly a problem with the frameworks themselves that porting a website (even just to add a little functionality) isn't as easy as setting one up initially but there's not really much an individual can do here. It's one reason I like frameworks like Preact so much, they're actually trying to fix this.
- epistasis 2y agoAs the old man screaming at the cloud, about the insane complexity of modern JavaScript frameworks, who hasn't done much with them and kind hates the experience of dealing with them at all, I hope you are right. Can I still use my basic HTML knowledge and be productive? I've instead just given up doing any frontend work because I don't want to spend my time in React. Give me something simple, concrete, and understandable like an advanced algorithms textbook, and I'll go to town. Reading user guides or documentation of Typescript/Javascript frameworks feels impossibly hard in comparison.
- ecshafer 2y agoWorking with Turbo and Stimulus with Rails is such a breath of fresh air for me for this reason. Sure its not just writing HTML, but its such a vastly simpler framework for creating a responsive web page than React, Vue, Angular, etc. I don't know how React and the like became the de jour of Web development, its quite a complicated beast. I am partial to DHH's interpretation it was off of zero interest rates and free money.
- dzonga 2y agothis is key, working with rails and stimulus - you get to escape the nonsense. but we also have to admit reality - it's easier to pay *rent with react and friends than with other full-stack frameworks. well it used to be and still is till interest rates went up.
- hnthrow90348765 2y agoI can't think of any job postings I've seen recently that only wanted straight-forward web development. Everything was asking for a major framework + other supporting libraries for the front end. I'm only 40 and also screaming at the clouds, but I simply don't have the luxury of ignoring some of the larger things like React that gave me a job today. This is the market pressure which is driving things towards more abstraction. Another iteration will add more abstraction on top of that. I'm fairly certain it can't be stopped now. Doing so would mean convincing tech leadership to start actively managing what technologies go into their products and striving for a "less is more" or minimalism approach.
- alexashka 2y ago> I've seen teams estimate a full day to add a link to a contact form because they need to Has it ever occurred to you that maybe it only takes them 15-30 minutes (still too much, obviously) but that it is great to be able to only work 15 minutes/day? Estimates reflect what managers will say ok to, not how much real work it takes.
- simonw 2y agoNo, I've seen them do the work. Refactoring those React components genuinely takes ages.
- alexashka 2y agoDoes it? I'm all too familiar with bad codebases where yes, trivial changes take days. That's not the fault of the library. It's the fault of the people using the libraries. I'm not a big fan of web dev at large but there's nothing inherent to React's architecture that makes editing a single component to add a static link difficult (that I'm aware of). What you're describing is typical average dev that creates impossible spaghetti code and then with an honest heart tells project managers how hard it is to change the color of a button because of incomprehensible tech jargon until the clueless PM goes 'okay okay, will two days be enough?' and the dev goes 'yes, I think so'.
- bavell 2y agoSays more about the team than React.
- sgarland 2y agoTo spend the other 400 minutes learning something new, right?
- someothherguyy 2y agoI strongly encourage new junior hires to read MDN, specifications, etc. However, for some, it is like they cannot absorb information if its not in video format.
- dehrmann 2y agoI'm frustrated at how often a how-to for something that takes three sentences to explain is a video. At the same time, it's amazing for things like simple home and car maintenance.
- rikthevik 2y agoI totally agree. It's like we've forgotten what browsers and HTML are meant to do. Back in the day we used to rail on Flash websites because while they looked nice, they weren't accessible to screen readers etc, sites weren't consistent, links didn't turn purple, and the back button didn't work. Now we've done that again with HTML and React. Flash is dead, long live Flash.
- freetonik 2y agoReact and similar frameworks are still generally better for accessibility compared to Flash, but at the same time can be worse because pages may behave sporadically and in unexpected ways, whereas Flash would be a blindspot for many screenreaders and related software.
- mainguy 2y agoI don't think that's an exact analogy....maybe if you're using react in some oddball/low skill way. Flash (and ...javafx/applets/whatever the id equivalent was...I can't remember) were 1000x more bumpy than react.
- nunodonato 2y agothis is why I dislike the modern web so much. I love to find websites that are nice and simple, load fast, and have no JS bullshit to render "modern" UIs. But yeah, old man yelling at cloud and stuff... but you know what, I'm fine with that. And I do have the hopes of building something useful and successful that gives the middle-finger to all these "modern" frameworks.
- deleted 2y ago[deleted]
- blackoil 2y agoIt looks all these rants are from people who need "Hello World" equivalent of web and are angry that there are tools for more complex use cases. I am primarily a backend developer with couple of decades of experience, who is now working on his own startup. I have built a simple HTML/JS site as our launch page. But I would kick out anyone who'll suggest that we should use plain HTML/JS instead of a frontend framework for our main app. A form submission is not just a post submit. You have to do client+server error handling, dynamically show/hide/add fields, show char count, handle intermittent state and still more. All of these are possible with JS but is faster and more reliable with a purpose-built library. Same goes for a draggable dashboard, filters for search results...
- MatejKafka 2y ago> A form submission is not just a post submit. Can be. And still work better than a lot of JS-heavy monstrosities.
- ozim 2y agoI agree but it is hard to explain to people what is a difference between a web app and what is 2-3 forms on a website. Lots of complainants I read seem like people who would do all in plain html never worked on actual web app. At the same time seems like JS stuff is overused in lots of places and a lot of React or Angular is done by people who want to have it on their CVs.
- intelVISA 2y agoOnly one day? They must be juniors, that's at least a month or two - few hundred story points, dozen alignment meetings, QA, stakeholder buy-in, A/B tests, security consult, PM/PO/SM/EM/TL sign off, heck just catching up with the UX team alone would add a day's worth of calls.
- Buttons840 2y agoAn underappreciated reason people pad estimates is that it gives them some time to breath and know what business goals they personally need to deliver. In the case of 1 day to add a button, let the developer have a day of knowing "today, my goal is to add a button". Without the padding the developer would be thinking "I'll add that button, but after that I have no idea what's coming, whatever bullshit comes down the pipe I guess". It's really hard to shift mental gears. People can do multiple tasks well, but only if there is a coherent thread they can follow through those tasks. Current software management philosophies are very hostile to those coherent threads.
- exe34 2y agoI don't do web stuff for a living, but I've been hacking since the early days of JavaScript - what I don't understand is what happened to separation of content, layout and interactivity - most of these react et al. monstrosities start with a big mess of JavaScript generating the html as lisp-like nested trees of tags. in that case, why not just use lisp?
- phist_mcgee 2y agoBecause not everyone likes writing lisp?
- exe34 2y agowriting lisp in JavaScript is so much worse!
- ozim 2y agoIt worked for documents and maybe sprinkling jQuery here and there. For web apps it breaks especially for SPAs really quickly. So I believe it went out of the norm like 10 years
- exe34 2y agoit's not like SPAs are more responsive today - they're horribly sluggish and things break constantly. modern and trendy doesn't mean better in any way.
- aleksiy123 2y agoPeople realized that slicing it that way wasn't nice to work with. The htmx guy has a small post on this. https://htmx.org/essays/locality-of-behaviour/ https://htmx.org/essays/locality-of-behaviour/
- ndriscoll 2y agoThe example there is kind of poor. The problem isn't that the implementation is separated (in fact the implementation of `hx-get` is just ignored, which is cheating). The problem is that the jQuery example is using a button id to specify behavior instead of an attribute like the htmx version. Old CSS wisdom was to give your elements meaningful classes and apply properties to those. Or xpath let you do pattern matching on elements/attributes and apply templates to that. So the jquery version could be the same as the htmx one, but you do `$('[hx-get]').on("click"){...}` or whatever (I don't know jQuery/do javascript).
- floydnoel 2y agowoah! i couldn't agree more. i built my own router for React because i was exhausted by having every link be some overly heavy abstraction around... a few characters of text. KISS is key for me.
- moomin 2y agoIt doesn’t take a day to do it. It doesn’t even take a day with refactoring. But add in writing the tests, running through QA, code review, getting release approval &c &c and almost anything can take a day.
- simonw 2y agoRight. I don't think adding an HTML link has nearly that much organizational overhead either.
- cableshaft 2y agoIt would at the client I'm working for. Nothing hits Production without going through code review, getting UX approval, testing by QA, UAT testing and approval by product managers, running the automated test suite for the entire application (which takes several hours by itself) to make sure nothing else is failing for any reason, and running through various pipelines. Except maybe a couple of desperately needed hotfixes that process has never taken less than a full day. Doesn't matter if it's a one line code change (some of my bug fixes have been exactly that). And often it takes longer because it can take some departments a while to get around to their part of it as they have other things they're working on for other features and tasks as well.
- andrei_says_ 2y agoInput type=“search” has some additional niceties. Html5 is great. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/search https://developer.mozilla.org/en-US/docs/Web/HTML/Element/in...
- dzonga 2y agoUnfortunately, many of us are choosing to forgo the productivity gains you and DHH provided via Django and Rails. Forever grateful to you folks.
- testbjjl 2y agoThe complexity makes automated testing easier. We arrived here for reasons that may or may not not be critical to you but warranted implementation nonetheless. There is no conspiracy.