Hacker News new | ask | show | jobs
by marricks 1651 days ago
I hate to be that old foggy but, aren’t websites just getting worse and bloated with JS crap?

I’ve had a couple websites I use daily for work just get flashy new interfaces which causes 1/3 to 1/2 second delays in the interface which used to not exist, previously they just had normal page load delays.

For example, SalesForce Lightning, their UI overhaul. Old UI is mainly just flat HTML with some loading on fields. New UI doesn’t have as many page loads it seems but wherever you navigate to takes far longer to load because of api calls or just baaad JS.

Slow for the user, slow for the server. It's almost like the people who push website technology are the same one selling you servers. Hate it and want to go back.

9 comments

I agree with this so so much.

The problem is too much reliances on frameworks and add on libraries.

Developers will import an entire framework that for the benefit of a single feature. It's mind blowing to look at the amount of js includes for seemingly simple sites.

Stackoverflow answers that direct you to import a library or framework should be banned in most cases.

I will often have to scroll past several answers that say to import a library before finding a simple and functional answer that uses only a few lines of code down near the bottom. Which in my eyes is the real answer. I often wonder if there's a behind the scenes effort on SO to promote certain includes.

The entire ecosystem of some languages / implementations relies on this far too heavily.

We are seeing some of the consequences other than just bloated systems from this style of coding with malicious node packages.

I am guilty of this, and I feel bad for it. I am not a front end developer, but I have built a few web sites for various projects here and there. I certainly don't NEED to use a front-end framework, but I don't want have to spend a ton of time crafting CSS rules and figuing out how many divs to nest. To get something done quickly, my choices pretty much boil down to plain, unstyled, pages, or a full blown framework like Vuetify. So far, I haven't found anything in between. I would love to find a CSS library that I can just import and be able to create simple, nicely styled pages, e.g. that look Material-esque, without jQuery, node, npm, gulp, grunt, sass, and all that jazz.
do you know the matrix movie quote "but there is no spoon" – maybe the framework you look for is vanilla CSS. Write sensible markup to hold your content (almost no divs), CSS it and be good. Sounds that feasible?
> ... vanilla CSS... Sounds that feasible?

Vanilla CSS is the other end of the spectrum, but the problem is there is apparently nothing between hand-crafted CSS and a full front-end framework. People, like me, who are not good at design will choose the convenience of the latter over going through the tedium of the former, even if we don't really want to.

You won't be a sculptor if you avoid the chisel. If in rome, do as the romans do. If you want to swim, you'll get wet.

There is no design in/for the web without html+css, is there?

Edit: by removing 3rd parties from your project you remove a lot of overhead and current and future risk. But be warned: Maybe your company sells exactly that for a good margin and you ruin the business model.

We don't want to sculptors. We have other projects that just happen to require a sculpture as part of finishing them.

> There is no design in/for the web without html+css, is there?

Only as much as there's no programming without assembly language.

What's your opinion about bootstrap? Unfashionable I get it, but doesn't it serve the purpose?
It's been a long time since I looked at Bootstrap. I don't remember it being anywhere near as easy to create a nice-looking page with it as it is with Vuetify.
How about Tailwind?
Bootstrap is unfashionable?
In the same way that Corollas, Applebee's, and Walmart brand jeans are unfashionable, yes.
Bootstrap v2 had a LOT of unnecessary features while simultaneously lacking features because of Less limitations. By v5 it was significantly slimmed down if not for removing IE support and jQuery, but also a lot of rarely-used components.
aren’t websites just getting worse and bloated with JS crap

Maybe they are, but that bloat is just some static files that are sent to the user as far as the web server is concerned. They should have no practical impact on the battery life of the server.

There are JS sites that render on the server as well, but that's not the bloat you mean.

And, heck, there's a solid argument that server-side rendering is more environmentally efficient, since the work is done in a data-center, which can (1) utilize caching to avoid re-doing work and (2) be built in an optimal location for electricity generation.
Conversely, you are losing the distributed computing gained by rendering on the client, and therefore need a bigger server to scale when needed. And HTTP caching can and should be used for API responses as well.
If we're measuring by total resource consumption regardless of location, is distributed computing beneficial? Your server can be less powerful, but the client needs to be more powerful. I'd think the primary difference is who's paying for it.

Sure, most clients may already be adequately provisioned, but only because so many websites with bloated Javascript have forced their hand...

>Maybe they are, but that bloat is just some static files that are sent to the user as far as the web server is concerned. They should have no practical impact on the battery life of the server."

...and if those static files make 100 API calls as soon as they land?

I think he is talking about badly written JS code serving the APIs and the overhead of it.

Of course it's hard to debate whether JS, Java or PHP is most inefficient in that regard.

I strongly believe that the efficiency of an API is 1% down to the language it's coded in, and 99% down to who coded it.
Yes and no; while it's still true that you can write FORTRAN in any language, there are network effects that mean the effort required to write efficient code is different per language/community/framework.
I think that’s true if you take a no dependencies approach but as soon as you tap into the ecosystem the argument is lost.
Not really. It still depends on who coded it. It's just that there's more people involved now.
Corollary: The average API is far less efficient than the languages you like to complain about their efficiency.
it's gotten out of hand imo. page load times take longer than when I was browsing the web on dialup in many cases.
Website Obesity crisis going on and on: https://idlewords.com/talks/website_obesity.htm

Was here on HN several times, sadly still the case.

"I don't care about bloat because it's inefficient. I care about it because it makes the web inaccessible.

Keeping the Web simple keeps it awesome. "

I don't know, we're currently rewriting our UI from the classic "PHP renders everything with almost zero JS" to the more modern "single page application with a crap ton of JS" and the new UI feels much faster to me. The old way was to resend and rerender everything on each click, which is problematic for complex UIs with a lot of data.
On a modest 3 year old phone running Firefox, such websites are excruciating.
What a false equivalence. You are comparing static sites of the past to dynamic sites of today. Apples to oranges.
The vast majority of sites don't need to be dynamic though.
[citation needed]

Websites have become significantly more complex in the last two decades.

Let’s look at Twitter for a real-world example. The core concept of it hasn’t changed, it still just has to display a blurb of a few hundred characters at most. Back in the day this was achieved by server-side-rendered HTML and a simple form POST. I don’t have the numbers for the page back then but I’d estimate it at 100KB - nowadays it’s a multi-megabyte-sized pile of shit that often fails at its primary purpose of displaying a block of text with a stupid “something went wrong” message or endless spinner.

The “new” Reddit is also a good example. Even ignoring all the user-hostile functionality changes, the actual experience is still slower and less reliable.

And for proof that you can do better, Nitter is a better Twitter interface than Twitter is, and it's much lighter.
Reddit web is incredibly sluggish. I open the app to browse which is a smooth experience (putng aside dark patterns).

Same for Twitter. Maybe it's intentional to move users into the app, where ads are more likely to be actually seen (e.g. Many web users have ad blockers) and in app purchases are frictionless.

Really ?

Take for instance news sites or blogs: When I read news article, what I want is mostly (there are some great interactive infographics, but those are tiny minority) text and few images, that are static.

And it's not like that as a consumer I get anything extra. The text and images are still static, for the most part. Except that now its makes 20 separate requests to load it all up. Hell, pages are usually even less dynamic, after comments fell out of favor.

What increased is number of extra stuff, that is mostly focused on selling me stuff, tracking every metrics possible, and trying to figure out somne clickbait I would click next for extra engagement.

But that's not content, content has largely stayed the same.

I don't believe the bloat of modern websites is because of ad-tech of dark patterns - all of these can still be done with an otherwise lightweight website. If anything, ads (excluding intentional resource usage such as crypto-miners) would be much lighter than what a typical SPA website like Reddit or Twitter is.

I believe what's happening is a broader trend in the industry of building engineering playgrounds and doing engineering purely for engineering's sake to benefit one's career - a positive feedback loop where not participating puts developers at a disadvantage as they won't gain over-engineering skills that companies now require (they require them because their developers or managers want them for the same reason).

Text-only NPR: https://text.npr.org/
I don't want my browser to be loading entire JS frameworks and trackers and whatever other crap just to read a bunch of text. That's absolutely nonsensical
I'm using two browsers, one with disabled JS (primary) and vanilla one. When and only WHEN page doesn't load on non-js browser (and if I really, really, reaaaally want that piece of content) then maybe I will use vanilla browser...

Browsing with js disabled is fast, pages load quickly, almost no trackers and there are "old" or "text" versions of sites still available... old.reddit, old.twitter or nitter instances...

Heck, even google has one...

To be honest, I just use dillo browser most of the time. Small, speedy and safer then most...

Edit: typo.

For the user's benefit, or for the dev's?
Or the advertises/whatever assholes profit of “engagement”?
When you replace one with the other and notice a substantial change in time-required-for-task, I think you can make comparisons.
We’ve recently transitioned to Salesforce for a project. It’s remarkable how laggy the interface is. Removing a line from a quote takes three clicks and four seconds. The UI also doesn’t always refresh the items in a reasonable period of time, requiring a page reload.

Reloading the page is like 20MB as well. Great when you’re tethered to your phone.

I agree. There needs to be a substantial effort in web development to shed the bloat. Clean and small reduces issues with resources, security, and maintainability. The status quo is gross.
You're not alone in feeling this way

https://handmade.network/manifesto

>and bloated with JS crap?

CSS animations too , especially the ones that use infinite.

Nothing to do with site hosting. css animations don't eat the server's CPU; nor does JS bloat (other than bandwidth).
JS bloat can have significant server overhead when data is loaded dynamically. It’s generally more efficient to have one GET request that can be heavily optimized than a lot of tiny XMLHttpRequest that need to be parsed separately. That may flip around when someone spends a long time interacting with a SPA, but there is plenty of truly terrible code in the wild.
I've built embedded web interfaces serving up static pages that were precompressed with gzip and then used XHR to fill in dynamic content. I kept it under 100K for the uncached download (zero third party scripts). Everything worked well and was reasonably lightweight as long as you avoided framework bloat. Not having to compress anything on device helps a bit on energy usage although that wasn't a concern.
> It’s generally more efficient to have one GET request that can be heavily optimized than a lot of tiny XMLHttpRequest that need to be parsed separately.

Without context, this statement is misleading at best and downright false at worst. You’re right that splitting up a single request into multiple would incur a small performance penalty, but you also generally gain other advantages like more localized caching and the ability to conditionally skip requests. In the long run, those advantages may actually make your app significantly more efficient. But without discussing details like this, it’s pointless to make wild assumptions about performance.

The context was JS bloat, so we are specifically talking about the subset of poorly written sites. When it’s possible to shoot yourself in the foot many people will do so.

That said, if you ever actually profile things you will find the overhead per request is actually quite high. There is a clear tendency to request far to little data at a time.

yes, I wanted to add that css (especially infinite)animation also eats the client energy and CPU.
I like a good clean CSS animation! They can be very short and meaningful. Maybe not for daily driver UI but somethings I like them.

Infinite scrolling could be annoying with animations though, I grant you that.

My issue is with infinite animations, constantly moving/blinking stuff. They also do not have same effect on different system configurations so you might not notice any effect on your dev machine and on users it makes the page unusable, and some are super distracting).
The new lightning makes it such a pain to do my time cards. Try to open my sub projects to see how many hours are left and have a tab open with my time card and constantly errors out. I can’t be the only person who checks hours left on sub projects when entering my time.
Genuine question from a not-a-web-developer: Is this not mitigated by minimization tools like webpack?
Webpack is a front-end build toolchain, not a minifier. Usually Terser is used inside of Webpage to minify.