30 votes

The Cost of JavaScript in 2018

21 comments

  1. [9]
    demifiend
    (edited )
    Link
    I saw this a couple of days ago on Mastodon, and was ambivalent about without understanding why. I don't think the web is bloated by UX. I think the web is bloated by adtech, user surveillance,...

    I saw this a couple of days ago on Mastodon, and was ambivalent about without understanding why. I don't think the web is bloated by UX. I think the web is bloated by adtech, user surveillance, autoplaying video, and a pathological insistence on using large, poorly compressed images.

    Most of this has little to do with user experience, and I don't think developers have much control over it. You can optimize the living shit out of your site's JS, get it down to less than 100K of compressed/minimized JS, and the user might still have to wait 20 seconds for the page to load because adtech developers just don't care.

    It isn't just JavaScript that's ruining the web, though the Web would be better if end users could control JavaScript the way they can control cookies:

    • Deny all
    • Allow from sites you visit
    • Allow from sites you visit and third-party sites

    Or maybe we need to accept that progressive enhancement is dead, and that we therefore need two webs: a Hypertext Web, and an App Web.

    PS: Might be worthwhile to mention a similar discussion on "The Bullshit Web".

    24 votes
    1. [6]
      lars
      Link Parent
      Times have changed. When I was in HS you had to build a site with the thought JS might not be available. That is so old hat now.

      Times have changed. When I was in HS you had to build a site with the thought JS might not be available. That is so old hat now.

      10 votes
      1. [3]
        Deimos
        Link Parent
        Yeah, I mention this change in approach in Tildes's technical goals as "flipping the web pyramid".

        Yeah, I mention this change in approach in Tildes's technical goals as "flipping the web pyramid".

        15 votes
        1. [2]
          lars
          Link Parent
          I strongly agree with this. I always felt leaning on the html and css was the way to go. It's so cool what we can build now too with frameworks like DJANGO. Python is such a useful language.

          I believe that relying on JS to this level is fundamentally the wrong approach to the web, so Tildes is built in the "traditional" manner. Javascript is used as minimally as possible, and ideally only when it's the only option for accomplishing something. And because of that...

          I strongly agree with this. I always felt leaning on the html and css was the way to go. It's so cool what we can build now too with frameworks like DJANGO. Python is such a useful language.

          10 votes
          1. [2]
            Comment deleted by author
            Link Parent
            1. userexec
              Link Parent
              It's so much more flexible than many imagine. It ended up being my primary language since I worked mostly in web development, but with things like node and headless browsers it's become capable of...

              It's so much more flexible than many imagine. It ended up being my primary language since I worked mostly in web development, but with things like node and headless browsers it's become capable of far more. You can easily write bots in it that can use practically any part of the web as if it had an API, even if it doesn't. I'm sure that can be done in other languages, too, but the barrier in JS is downright ankle high these days.

              1 vote
      2. [2]
        demifiend
        Link Parent
        I don't think you could count on JS being widely available until around 2010.

        I don't think you could count on JS being widely available until around 2010.

        2 votes
        1. lars
          Link Parent
          Yep. Class of 07.

          Yep. Class of 07.

          3 votes
    2. [2]
      userexec
      Link Parent
      That pathological insistence on using large, poorly compressed images hits so close to home for me. I oversee an army of content authors who don't necessarily do web, and by and large they don't...

      That pathological insistence on using large, poorly compressed images hits so close to home for me. I oversee an army of content authors who don't necessarily do web, and by and large they don't understand things like resolution because that's not their primary job--content expertise is. Our CMS doesn't automatically scale image resources based on where they're used and cannot enforce image size limits (and if it did my call volume would increase to absurd levels), so it's a losing battle trying to ensure they don't slap a 6MB image on an otherwise fast page. I go in after them and fix it when I see it, but it's definitely an issue.

      7 votes
      1. demifiend
        Link Parent
        This is easier to manage on my own website. All I need do is run a shell script. It's gotta be more complicated for you, so you have my sympathies.

        This is easier to manage on my own website. All I need do is run a shell script. It's gotta be more complicated for you, so you have my sympathies.

        3 votes
  2. dblohm7
    Link
    Some current and former colleagues of mine are working on a new way to accelerate JS loading called BinAST. It's a really cool idea that will help lower the cost of JS. Unfortunately it seems...

    Some current and former colleagues of mine are working on a new way to accelerate JS loading called BinAST. It's a really cool idea that will help lower the cost of JS.

    Unfortunately it seems like, on the web, JS is like a gas: it expands to fit its container. Browser devs can keep throwing all kinds of optimizations to speed things up, but many web devs will just use that extra time to add even more bloat. It's induced demand, just like freeway capacity.

    12 votes
  3. [3]
    demifiend
    Link
    How much do websites need to do? I think that's a conversation we should be having, but haven't been.

    A lot of this is the result of shiny new tools, they get you excited and many don’t always guide you through good practices along the way, as others have said js grows to fill the available bandwidth and computation resources, however we improve it the most common end result is going to be websites that do more, not load faster.

    How much do websites need to do? I think that's a conversation we should be having, but haven't been.

    5 votes
    1. [3]
      Comment deleted by author
      Link Parent
      1. [2]
        demifiend
        Link Parent
        I think the use cases are going to have to diverge eventually, anyway. As it is, we have web browsers trying to serve two use cases: Web browsers as hypertext navigators/renderers Web browsers as...

        I think the use cases are going to have to diverge eventually, anyway. As it is, we have web browsers trying to serve two use cases:

        • Web browsers as hypertext navigators/renderers
        • Web browsers as virtual machines for web apps

        What if we split these use cases into two separate applications? What new features could we offer on a web browser specialized for hypertext viewing? What improvements could we make for web app browsers?

        3 votes
        1. super_james
          Link Parent
          If you care about this hypertext researchers have been writing papers about it since before the www existed. Happy to ask a websci friend for a reading list.

          What new features could we offer on a web browser specialized for hypertext viewing?

          If you care about this hypertext researchers have been writing papers about it since before the www existed. Happy to ask a websci friend for a reading list.

          1 vote
  4. [8]
    jackslack0
    Link
    I normally disable JavaScript on my browser. To disable JavaScript in Firefox/Waterfox: Go to about:config Search for JavaScript Find javascript.enabled Right-click & click toggle

    I normally disable JavaScript on my browser.

    To disable JavaScript in Firefox/Waterfox:

    1. Go to about:config
    2. Search for JavaScript
    3. Find javascript.enabled
    4. Right-click & click toggle
    3 votes
    1. [3]
      Deimos
      Link Parent
      I use uMatrix with all scripts disabled by default and need to individually whitelist them. I like that better than having it completely disabled, since it still allows me to fix sites that don't...

      I use uMatrix with all scripts disabled by default and need to individually whitelist them. I like that better than having it completely disabled, since it still allows me to fix sites that don't work without JS, and I can be more selective about only allowing things that I trust (and avoiding analytics, advertising, etc.)

      12 votes
      1. [2]
        jackslack0
        Link Parent
        Thank you, I'll have to look at that.

        Thank you, I'll have to look at that.

        1 vote
        1. amoeba
          Link Parent
          uMatrix is a great extension, if you're willing to put some time into learning how it works. It's made by the same dev behind uBlock Origin. If you're using Waterfox, I think this link will work...

          uMatrix is a great extension, if you're willing to put some time into learning how it works. It's made by the same dev behind uBlock Origin.

          If you're using Waterfox, I think this link will work for you, if you want to add the extension: https://addons.mozilla.org/en-US/firefox/addon/umatrix/

          3 votes
    2. [4]
      s4b3r6
      Link Parent
      Just diverging from the topic a little... What's the difference between Waterfox and Firefox? I did dig around a little on the website, but single sentences don't actually give back a lot of...

      Just diverging from the topic a little... What's the difference between Waterfox and Firefox?

      I did dig around a little on the website, but single sentences don't actually give back a lot of information.

      What I have is that it's a fork of Firefox, that doesn't collect analytics.

      Is that it? Or did it diverge before WebExtensions, or before Quantum?

      How is it different?

      Sorry if that seems like a lot of questions, I just thought you might know as you use Waterfox.

      2 votes
      1. musa_totter
        Link Parent
        I don't use Waterfox, but off the top of my head it's a fork from before WebExtensions and won't be adding support for them. I don't know what the other differences are.

        I don't use Waterfox, but off the top of my head it's a fork from before WebExtensions and won't be adding support for them. I don't know what the other differences are.

        2 votes
      2. [2]
        jackslack0
        Link Parent
        Privacy is the reason I use it. Firefox has plenty of analytic collection which I really don't like. Sorry for a really really late reply.

        Privacy is the reason I use it. Firefox has plenty of analytic collection which I really don't like. Sorry for a really really late reply.

        1 vote
        1. [2]
          Comment deleted by author
          Link Parent
          1. jackslack0
            Link Parent
            I don't trust a browser that has analytic collection to not steal my data.

            I don't trust a browser that has analytic collection to not steal my data.