News for hackers. Stuff that matters.
Re:Why is modern web development so complicated? by tschellenbach on Wednesday August 07, 2019 @03:50PM (#20638200)
It's complicated because the bar in terms of user experience went up (or so they say) and now everyone wants a SPA. Because of this you now have a generation of devs that only knows how to build SPA. I'm actually thinking to move some stuff from Django to Gatsby/React setup just because everyone knows React, and a lot of our new devs don't know Django/Python.
Re:Why is modern web development so complicated? by mort96 on Wednesday August 07, 2019 @04:07PM (#20638374)
"Everyone wants a SPA" is such bullshit. GitHub used to just load for a hundred milliseconds and then show me everything I needed; now it loads for a hundred milliseconds and shows me a spinner while it does another roundtrip for some javascript, then parses and executes that giant truckload of code, then does _another_ roundtrip to get the JSON or whatever describing the data I actually want to see, then executes its boatload of javascript to update the DOM. Reddit is the exact same story; in the time it used to take to show the content, it now manages to load a spinner. Facebook also just spends the first few hundred milliseconds loading loading indicators. YouTube too.

Browsers are awesome at rendering HTML. They render each element the instant just the necessary bytes have crossed the wire. Browsers can't help you if you need to first load the HTML, then load the scripts, then load the complete giant JSON blob from your API, then add the elements to the DOM.

I'm in Norway, with high ping to the US. My ISP isn't the most reliable all the time. That nice server you have 0.01ms ping to, where you can't notice the difference a few extra roundtrips makes? Well, each roundtrip might take an extra few seconds for me.

Re:Why is modern web development so complicated? by pojzon on Wednesday August 07, 2019 @04:46PM (#20638843)
The worst example I can think of right now is: GMAIL..

God it went downhill lately. It can take 20 seconds on a decent machine for it to load all the shitty plugins i dont even need but still block me from using a mailbox..

Loading "html only" version is pretty much instant and has everything I need to use the demn mailbox..

Re:Why is modern web development so complicated? by NeoBasilisk on Wednesday August 07, 2019 @06:33PM (#20639914)
Wow, I had this exact thought the other day. I loaded the page, and just sat there and watched this animation on the screen. "What is it doing" was all I could think. All I need it to do is load the subject line of the first however many emails in my inbox. It can't be that complicated.
Re:Why is modern web development so complicated? by buboard on Wednesday August 07, 2019 @10:01PM (#20641149)
try adsense / adwords / google search console if you think gmail is slow. will be an interesting experiuence
Re:Why is modern web development so complicated? by onion2k on Wednesday August 07, 2019 @04:37PM (#20638735)
GitHub works without JS just fine. Switch it off.

In fact, I'm pretty sure Github is rendered server side for the first load. You shouldn't be seeing any spinners. I'd check if I wasn't on my phone.

Re:Why is modern web development so complicated? by mort96 on Wednesday August 07, 2019 @04:44PM (#20638821)
Nope, the content is loaded dynamically from their API after the rest of the page has loaded: https://i.imgur.com/Kxs9l7j.mp4

Sure, the list of my repositories is server rendered, but I already know my list of repositories. The thing I'm waiting for 99% of the time when loading github.com is to see if there's any new activity.

Sorry about the graphical glitches, blame nvidia or xorg or gnome or something.

Re:Why is modern web development so complicated? by onion2k on Wednesday August 07, 2019 @04:50PM (#20638890)
That's disappointing. You're absolutely right that that particular page should be SSR'd.
Re:Why is modern web development so complicated? by TurningCanadian on Wednesday August 07, 2019 @06:18PM (#20639774)
Likely because the list of repositories changes infrequently, so it's a better candidate for caching. They serve what then can quickly, quickly, then pull in the naturally slower stuff later.
Re:Why is modern web development so complicated? by Izkata on Thursday August 08, 2019 @11:45AM (#20645568)
Like 5-10 years ago, writing.com updated their content from loading static pages to be more dynamic.

What they actually did was continue loading the content statically, then hide it behind a 1 or 2 second loading spinner that wasn't actually loading anything.

Seems like users have just come to expect spinners...

(I don't know how the site currently works, haven't been there in a long time)

Re:Why is modern web development so complicated? by hdfbdtbcdg on Thursday August 08, 2019 @04:52AM (#20642856)
Github is annoying. Some pages are SSR some aren't. The js is quite resource hungry so I tend to keep js off for github until I get to a page that needs it.
Re:Why is modern web development so complicated? by BlueTemplar on Thursday August 08, 2019 @09:28AM (#20644314)
Have you considered just stop using these shitty "websites" ?
Re:Why is modern web development so complicated? by eswat on Wednesday August 07, 2019 @03:55PM (#20638251)
I think we’ve done a great job of convincing each other within our tech bubble than everyone wants a SPA. Not sure the general public cares for our enthusiasm though.
Re:Why is modern web development so complicated? by projectileboy on Wednesday August 07, 2019 @03:59PM (#20638293)
This, this, this. Users didn’t ask for magazine websites - which should be serving up, y’know, images and text - to sit and spin on my phone while all the Javascript libraries load. Users didn’t ask for these things; we as a community just decided to foist it on them.
Re:Why is modern web development so complicated? by TurningCanadian on Wednesday August 07, 2019 @06:20PM (#20639795)
A lot of the slowest stuff on websites are trackers that are being foist on developers to foist on the users (if the developers even have control over the trackers, like with GTM)
Re:Why is modern web development so complicated? by buboard on Wednesday August 07, 2019 @10:03PM (#20641158)
so you say, but i get the same when using ad blockers or visit sites without ads.
Re:Why is modern web development so complicated? by ayushgp on Wednesday August 07, 2019 @04:04PM (#20638340)
Everyone(well almost) wants a SPA or at the very least non reloading pages. No one wants to reload the page with every action they perform or if only a part of the area on screen needed to be updated and the page was reloaded anyways.
Re:Why is modern web development so complicated? by acdha on Wednesday August 07, 2019 @04:21PM (#20638518)
> No one wants to reload the page with every action they perform or if only a part of the area on screen needed to be updated and the page was reloaded anyways.

That's what developers talk about. What normal people care about is the user experience: did an action take a long time, did it reset their context or fail into a confusing state, does the reload button work / can they share a link with someone else, etc.

That's an important distinction because using an SPA means an order of magnitude more code has to work perfectly before it's not a regression on one of those points. It's a lot easier than it used to be but, as we've seen over and over again, there are still many cases where people have a bad experience because the developer assumed everyone is fine downloading 5MB of JavaScript before displaying text & images, errors never happen, etc.

Re:Why is modern web development so complicated? by wirrbel on Wednesday August 07, 2019 @04:18PM (#20638478)
I'd say I am a fairly layed back guy on web pages, I don't run no-script, I just care for being able to navigate a web page reasonably well.

To me it just seems that most SPAs that I see, are either so small that the page load of a django app would also be fast enough, or they are so overloaded with stuff and advertising, that I feel like the performance benefit of SPAs has just been reinvested in cluttering more. Also, facebook, who built react, don't seem to have embraced the SPA.

I guess there will be a sweet spot, also on whether you build "pages" or "apps". Maybe there is a point of interactivity that warrants a SPA. I just don't feel like many websites hit this, like microblogging/twitter/etc.

Re:Why is modern web development so complicated? by Keyframe on Wednesday August 07, 2019 @04:08PM (#20638378)
Yet, here we are at HN.
Re:Why is modern web development so complicated? by buboard on Wednesday August 07, 2019 @10:04PM (#20641165)
> no one wants to reload the page with every action they perform or if only a part of the area on screen needed to be updated and the page was reloaded anyways.

well not 'no one'. When 90% of the page is to be replaced, a full reload gives better feedback and synchronicity.

Re:Why is modern web development so complicated? by snazz on Wednesday August 07, 2019 @04:27PM (#20638599)
Everyone (well almost) wants a server-templated site or at the very least a functioning back button. No one wants to sit and wait for 3 million lines of JavaScript to parse and run with every press of the back button (and probably not even get to the same state as before!).

Yes, I know there are some stellar SPAs that actually work. But I can't see why they're necessary 97% of the time and it really bothers me when I see a SPA where one isn't needed that breaks basic functionality like back buttons and right-click and all that other jazz.

Re:Why is modern web development so complicated? by goatlover on Wednesday August 07, 2019 @04:34PM (#20638691)
If it's a traditional website and not an app, then I'm totally fine with it reloading every time you navigate to a new page or submit a form. Modern servers and browsers are plenty fast for full page reloads, as long as there isn't anything extra slowing down the load or rendering.
Re:Why is modern web development so complicated? by onion2k on Wednesday August 07, 2019 @04:44PM (#20638808)
Most people say they are, but when you actually measure it you find engagement metrics are better for SPA sites, especially for ecommerce and social. Quite simply people spend more money if they can click fewer times. And thus we have things like infinite scrolling and ajax.
Re:Why is modern web development so complicated? by pseudalopex on Wednesday August 07, 2019 @05:41PM (#20639440)
Engagement metrics measure what people do. That may not be what they want.
Re:Why is modern web development so complicated? by simplecomplex on Wednesday August 07, 2019 @07:23PM (#20640282)
Care to link to those measurements ?
Re:Why is modern web development so complicated? by marcosdumay on Wednesday August 07, 2019 @05:23PM (#20639253)
I've never met one of those users that care wether you reload a page or not.

I've seen people that care if you create a SPA that shows a spinner for 10s before allowing the user to get any of your content, but those are not as numerous as Google's webmaster tools makes one think.

I've seen plenty of people that are perfectly fine with a page spinning for 90s before getting any content if the page has the data they care about.

So, any out of context claim like "everyone wants a SPA" is wrong.

Re:Why is modern web development so complicated? by lawn on Wednesday August 07, 2019 @04:10PM (#20638398)
Serious question: Why not have them learn Django/Python?

It's not that difficult if you're a decent programmer, and if they're not then why hire them?

Re:Why is modern web development so complicated? by itronitron on Wednesday August 07, 2019 @04:30PM (#20638639)
SPAs don't need to be complicated, people have been developing native GUIs for decades. The source of the problem is the browser event and rendering loop which remains a mystery.
Re:Why is modern web development so complicated? by heyyyouu on Wednesday August 07, 2019 @04:17PM (#20638473)
Yes, exactly. But to me in many ways that's application programming on the Web vs. Web programming. It may seem pedantic but it's two separate skill sets, and my teams that do each are separate (I have front-end devs that are basically application programmers using Angular/React and front-end devs who are CSS/JavaScript/Animation specialists -- they aren't the same teams).
Re:Why is modern web development so complicated? by travisl12 on Wednesday August 07, 2019 @05:19PM (#20639202)
This comment makes me realize, I need to get back to my RoR roots and build a server side rendered site again to see what I've forgotten with building React sites for a while.