6 ms·
The thing that confuses me about "modern", JavaScript-everything web development is that I just don't see the developer efficiency, at all. I've collaborated w
by simonw 7y ago
The thing that confuses me about "modern", JavaScript-everything web development is that I just don't see the developer efficiency, at all.
I've collaborated with many different teams that use the modern JavaScript stack. It seems to me that it takes multiples of time to deliver features compared to the old forms-and-HTML-with-a-tiny-bit-of-JavaScript-enhancement methodology.
Are we really optimizing for developer efficiency here? We've given JavaScript-everything a decade to prove that it's a better, more productive way of building higher quality websites and applications. I don't think it has.
- someguydave 7y agoOn the other hand, a decade of Javascript sprawl has been great for creating a business case for hiring more Javascript developers and paying them more.
- izacus 7y agoI think it optimises for developers ego and "fun" factor. If you actually read into posts around you can quickly see that the developer having fun is paramount to any solution - this is why everything needs to be a proper library and everything needs to be written in the developers favorite language. Ecosystems like JS driven Electron apps come out of this mindset.
- Touche 7y agoHTML with a tiny bit of JavaScript is just considered not an option at all, by the designers and the business. They don't want a HTML form post when you delete an item from a list, they want the item to animate out. So if you look at it like that, then yeah it is probably more developer efficient to do it the modern way.
- simonw 7y agoThat's the tiny-bit-of-JavaScript-enhancement. It's trivially easy to hook up a "delete" button such that it works without JavaScript, but if JavaScript is available it turns into a fetch() POST that removes the item (with a CSS animation) once it completes. Or if you're too lazy for progressive enhancement, you can skip the "works without JavaScript" bit. I used to do this kind of thing with jQuery one-liners all the time. Today browser compatibility is good enough that you don't even need jQuery.
- Touche 7y agoYeah but requirements are never that simple. You also have a cart item in the header that shows 4 but now must show 3, and you have a price that's over in the sidebar that needs to update, etc. Oh and the user is logged in and is receiving a notification that an item they were watching is now available, better show a toast. Sorry but the simple jQuery sites turn into soup once the requirements are what they are today. You can still do it, it's possible, it becomes harder and harder to maintain long-term though. Then efficiency becomes worse than how people do it today.
- simonw 7y agoSo many of the projects I've seen built with modern JavaScript aren't nearly that complicated though. They're building in anticipation of that complexity, but it never arrives. Look at how many content-oriented news website article pages have gone all-in on React, with the result that they serve up over 1MB of JavaScript just to show you an article with a "save" button that no-one ever clicks.
- Touche 7y agoThis is very true. I think, as this article describes, going through the process of discussing priorities as part of the initial architecture would lead to asking the questions about what the requirements really are, and what technologies best fit those requirements.
- simonw 7y agoYes, definitely. There are plenty of applications that benefit enormously from the modern JavaScript stack. I wouldn't dream of attempting something like Trello without React or similar! But I don't think it should be the default for every project without at least some careful thought.
- kethinov 7y agoI laughed when you said Trello because I just got done speaking with a colleague who complained that it locks up on her every time she tries to screen share while using it; the only web app she works with where she has this experience. It's obvious that the over-reliance on JavaScript is the reason for this and if Trello had a non-JS option she would surely take it even if the UX was "worse." (What could be worse than the UI freezing constantly?)
- cknoxrun 7y agoI couldn't agree more. And I have also found there is a dogma surrounding JS technology that views plain old HTML generated on a server as bad practice and outdated. Yet, again and again I see fast and functional websites converted to JS frameworks, becoming slow, memory intensive/leaky, and less responsive.
- zozbot234 7y agoThe new dogma is "plain old HTML generated on a server is OK, as long as it's using node.js on a client-side oriented JS framework". Of course it's just as slow and memory-leaky as a plain old SPA, but now you get that on both the client and the server!
- godot 7y agoQuoting this paragraph by the author: > First and foremost, there’s the end user. If a technology choice harms the end user, avoid it. I’m thinking here of the kind of performance tax that a user has to pay when developers choose to use megabytes of JavaScript. I believe the author is indeed talking about React (and other frameworks), SPA, big JS bundles. The developer efficiency being alluded to here is for tech startups to scale a team. A component-based frontend is valuable in providing that efficiency. The efficient is not about building a form in a few hours vs 2 days with React, but about code maintenance and scaling a team so many developers can work on the frontend at once in a sensible way. However, having said that, I am not an advocate for a React frontend. I actually recently wrote an article, on a different topic, but with a very similar theme [1]. I think component-based frontend framework solves a real problem in an organization, but it does not have the best UX in mind. [1]: https://dev.to/bigi/dev-to-is-the-perfect-demonstration-of-how-content-based-web-apps-should-be-developed-5fa4 https://dev.to/bigi/dev-to-is-the-perfect-demonstration-of-h...
- hinkley 7y agoI had a job with a bad case of NIH and my lead was a very upbeat guy. A couple months in he gave me kudos for getting something done in “only two weeks” This was work that would have taken less than a week on my first big frontend job and here it was noteworthy that I did it in twice the time. Confusing emotions. Initially I felt dirty. Or like I was in the beginning of a horror movie where it turns out the happy guy is the killer. And while I agree with the title on the article, I think it’s a shame because what we should be rewarding is effectiveness, not efficiency. I probably spend 20% of my time working on improving productivity and reducing variability for the whole team. Which means I get a little bit faster (and a lot less stressed out) in aggregate while everyone else gets a lot faster. That lead’s boss hired me specifically for that, but not all bosses are so enlightened (and he left a year later).
- deleted 7y ago[deleted]
- stickfigure 7y agoYour experience does not match mine. I worked through the pre-Javascript world, the jquery world, the angular1 world, and now the react world (not to mention a decade of native GUI development before that). I am vastly more productive with react and my UIs are much easier to use. Every time I submit some 1990s or 2000s era form that gives me an error because I typed some field wrong, but also wipes out half the other fields I spent 15 minutes typing... and of course, hitting the back button wipes out the remaining fields... I want to reach into the screen and throttle someone. No thanks.
- samastur 7y agoNone of the problems listed is inherent in HTML + touch of JS. Especially since most browsers these days will remember what you typed anyway unless specifically instructed otherwise. Complaining about the back button behavior in SPA world seems...misplaced? If anything, its behavior is even worse.
- andrewla 7y agoI think this is referring to the server round-trip -- form submit, server-side validation, "you have to specify a color for your widget" and everything on the field is blanked out because the server didn't fill in the default values into the form based on your previous submission. Back button stuff; I mean, it's not trivial to support it correctly now, and it might just be an increased focus on usability and testing of this sort of thing, but hitting back was always dicey -- half the time you'd get some error about re-posting form data when you hit back, and if you said no, bad things happened, and if you said yes, worse things happened.
- winkeltripel 7y ago> it's not trivial to support it correctly Back button works every time if you create pages, and navigate between them using links. There are some garbage web forms out there, but if we're comparing building SPA in 2020 or webforms in 2020, webforms is unlikely to screw up your back button.
- 7y ago
- ssalka 7y agoThe problem is, today's applications are not HTML forms with "a tiny bit of JavaScript enhancement." Today's apps are immense JS programs - tens if not hundreds of thousands of lines. Good luck scaling that without modern tooling.
- deleted 7y ago[deleted]
- simonw 7y agoMost of those applications don't need that though. Developers write hundreds of thousands of lines of code because that's what you have to do if you commit to a JavaScript-everything architecture. If the thing you are building needs that then go ahead and build it like that. But SO MUCH of what I see built on the modern JavaScript didn't need to do that at all.
- eska 7y agoBut many, perhaps most, of them could be. Just look at the amount of sites that are being converted to statically generated sites. Static HTML with some Javascript on top. A lot of websites were converted to this paradigm during the pandemic because the initial UX was that the site got DDOSed by legitimate, high load, or hacked. And this is from quick conversion (e.g. scraping a dynamic page, Wordpress plugins, etc). I think there's a lot more potential when sites are built with the static paradigm in mind. My personal blog for example is created by a static site generator I wrote in Rust myself. Instead of manually writing HTML, or using PHP and Javascript at runtime, I handle the complexity at build time. After having done frontend dev for 10 years this approach seems much more sane to me.
- inshadows 7y agoLast time I checked Twitter doesn't even use external stylesheets anymore. It's all in style="" in HTML, probably managed by their JS framework. And it loads super slowly.
- derefr 7y agoDepends on what you're trying to build/display. A sign-up form? Yeah, you aren't getting much from your SPA framework. Pure overhead. A data-table with user-selectable columns, pagination, and arbitrary sorting and filtering, where the data is too large to fit in memory (billions of rows) so you have to re-render by hitting the server; but the rows contain view-state components, so you can't re-render on the server? Two lines of code in an SPA; three months on your own. Equal resulting JS size, either way. And something like Grafana: how would you even do that server-side? Emit a server-sent-event stream of SVG images? This is a case where server-side rendering would result in heavier client-side code than an SPA would! ----- Now, the majority of people using SPAs don't need SPAs. I think people get into SPA frameworks like React because everybody wants to learn the frameworks and libraries, to have them in their pocket and on their resume, for when they (hypothetically) one day get hired for that one job where they do get to build the fancy slice-and-dice analytical data dashboard. That job probably would pay pretty well. They want to be qualified for that job. If you're a project manager, and you really value getting an MVP shipped quickly, you should push back on the engineering lead's desire to use an SPA framework. Ask them whether there's anything they're really gaining for this specific project. If there's no reason not to, then just suggest they build the app as a plain-old server-side-rendered-HTML app. Use Rails; heck, use PHP. (Or be fancy and use Phoenix LiveView.)
- SkyMarshal 7y ago> Are we really optimizing for developer efficiency here? Good question, we’re really not, we’re optimizing for making websites and webapps work and feel like desktop apps. >We've given JavaScript-everything a decade to prove that it's a better, more productive way of building higher quality websites and applications. I don't think it has. Not unless you count things like Google Maps, which wouldn’t be possible without SPA-style JavaScript.
- simonw 7y agoI am 100% on board with Google Maps and Trello being built using JavaScript-everything. Most of the things I've seen built using the modern JavaScript stack don't warrant working and feeling like desktop apps. They should work like fast-loading websites - especially on mobile phones, which is the source of most traffic these days.
- aboodman 7y agoYour experience doesn't match mine, either. I'll go to a lot of trouble to avoid server side development, which is partly why I love <s>Zeit</s> Vercel's offerings -- they abstract me from as much of the unix morass as possible. I think it might just be a matter of what feels like home to you.
- potta_coffee 7y agoI'm not a front-end developer. Often times I end up developing quick front-ends for internal tools, but I've also built them for customer facing products. I've become pretty competent with VueJs and I've been able to build features very quickly, sometimes in a matter of hours. If development is taking a very long time, I feel like that's more likely an organizational problem.
- alper 7y agoThere isn’t a good library for progressive enhancement. I know you can write it yourself quickly but it’s still boilerplate.
- impavid 7y agoJavascript has lowered the barrier to entry into the tech field (especially for `full stack` development). However that is all I'd say is the biggest achievement when it comes to increasing developer productivity/efficiency. Building a simple SPA in React with a few input fields results in 80+ files getting generated. The level of contortions that React (or other JS) framework goes through for a simple app would make even the most flexible contortionists in the world blush. Then there is the "Everything is a component" dogma that translates to single line components that bring down the internet -- see left-pad/is-promise fiascos. Serious high performing and large-scale enterprise apps ( read as software that does actual intense business app logic and CRUD ) would fall flat if Javascript-everything web development were adopted as a dogma. Javascript should stay where it is good at i.e. browser, and should stop with the impossible imposture of being a contender for serious server side programming.