Stories
Slash Boxes
Comments

SoylentNews is people

posted by martyb on Monday September 16 2019, @05:00PM   Printer-friendly
from the things-expand-to-exceed-the-space-provided dept.

https://danluu.com/web-bloat/

A couple years ago, I took a road trip from Wisconsin to Washington and mostly stayed in rural hotels on the way. I expected the internet in rural areas too sparse to have cable internet to be slow, but I was still surprised that a large fraction of the web was inaccessible. Some blogs with lightweight styling were readable, as were pages by academics who hadn't updated the styling on their website since 1995. But very few commercial websites were usable (other than Google). When I measured my connection, I found that the bandwidth was roughly comparable to what I got with a 56k modem in the 90s. The latency and packetloss were significantly worse than the average day on dialup: latency varied between 500ms and 1000ms and packetloss varied between 1% and 10%. Those numbers are comparable to what I'd see on dialup on a bad day.

Despite my connection being only a bit worse than it was in the 90s, the vast majority of the web wouldn't load. Why shouldn't the web work with dialup or a dialup-like connection? It would be one thing if I tried to watch youtube and read pinterest. It's hard to serve videos and images without bandwidth. But my online interests are quite boring from a media standpoint. Pretty much everything I consume online is plain text, even if it happens to be styled with images and fancy javascript. In fact, I recently tried using w3m (a terminal-based web browser that, by default, doesn't support css, javascript, or even images) for a week and it turns out there are only two websites I regularly visit that don't really work in w3m (twitter and zulip, both fundamentally text based sites, at least as I use them)[1].

More recently, I was reminded of how poorly the web works for people on slow connections when I tried to read a joelonsoftware post while using a flaky mobile connection. The HTML loaded but either one of the five CSS requests or one of the thirteen javascript requests timed out, leaving me with a broken page. Instead of seeing the article, I saw three entire pages of sidebar, menu, and ads before getting to the title because the page required some kind of layout modification to display reasonably. Pages are often designed so that they're hard or impossible to read if some dependency fails to load. On a slow connection, it's quite common for at least one depedency to fail. After refreshing the page twice, the page loaded as it was supposed to and I was able to read the blog post, a fairly compelling post on eliminating dependencies.

[1] excluding internal Microsoft stuff that's required for work. Many of the sites are IE only and don't even work in edge. I didn't try those sites in w3m but I doubt they'd work! In fact, I doubt that even half of the non-IE specific internal sites would work in w3m.


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 5, Insightful) by SemperOSS on Monday September 16 2019, @06:53PM (15 children)

    by SemperOSS (5072) on Monday September 16 2019, @06:53PM (#894765)

    It is a common misconception that JavaScript is required for any sort of real application, it is not. By using a reasonable amount of CSS and some applied HTML, a huge amount of functionality can be achieved without a single line of JS. I implemented a site once with drop-down menus, slide shows and other fancy things without a single line of JS. Even a pop-up calendar to choose dates from could be done in pure HTML/CSS. It takes time and effort to do this but the attitude of most web designers these days is that as long as it works on my computer using these select few browsers, then everything is honky dory. That is obviously a blasé attitude showing a blatant disregard for quite a few people that — due to no fault of their own — are lacking internet speed or sufficient computer power.

    And no, ads are not the main culprit. My bank's internet banking site is ad free but so riddled with JavaScript that I cannot use it properly from my previous laptop (waiting   f o r e v e r) and not at all from my old ASUS Transformer tablet where the website's timeout kicks in before the page has been rendered completely.

    I cannot remember what company, that forced their developers to not use the most modern, fast computers when testing their code to give them a realistic picture of what their users would actually experience. I think that every web developer should be forced to access their pages through an old 56k modem!


    --
    I don't need a signature to draw attention to myself.
    Maybe I should add a sarcasm warning now and again?
    Starting Score:    1  point
    Moderation   +3  
       Insightful=2, Interesting=1, Total=3
    Extra 'Insightful' Modifier   0  
    Karma-Bonus Modifier   +1  

    Total Score:   5  
  • (Score: 4, Touché) by Pino P on Monday September 16 2019, @08:16PM (5 children)

    by Pino P (4721) on Monday September 16 2019, @08:16PM (#894792) Journal

    It is a common misconception that JavaScript is required for any sort of real application, it is not. By using a reasonable amount of CSS and some applied HTML, a huge amount of functionality can be achieved without a single line of JS.

    "Huge" doesn't necessarily imply "comprehensive." One counterexample is a web-based whiteboard application. Say you want to let the user draw curves on a canvas. With JavaScript, you can have the user drag over the path of the curve. With HTML and CSS without JavaScript, you instead have to use a server-side image map and require the user to click at every point along the curve, causing a form submission and page reload after each click, and then click somewhere else to end the curve. Another is making nontrivial functionality available while the user's device is offline.

    Even a pop-up calendar to choose dates from could be done in pure HTML/CSS

    How is that done? The <input type="date"> element doesn't work on all browsers, particularly not Internet Explorer for Windows 7 and Windows 8.1 or Safari for macOS. Even current Firefox doesn't support type="datetime-local", type="month", or type="week". Or do you have it reload the page each time the user navigates to the previous or next month or the previous or next year?

    • (Score: 0) by Anonymous Coward on Monday September 16 2019, @09:03PM (2 children)

      by Anonymous Coward on Monday September 16 2019, @09:03PM (#894812)

      You have to remember that clicking the right thing interacts with the DOM. So if you get creative with the hiding and showing of elements, then you can do a full blown calendar. Between HTML, CSS, and user interaction, you can code any program you'd like into CSS. The real question is how complicated you'd like it to be, especially with other choices available. A calendar isn't that hard in its basic form, really its just how complex you want to make it.

      • (Score: 2) by Pino P on Tuesday September 17 2019, @12:46AM (1 child)

        by Pino P (4721) on Tuesday September 17 2019, @12:46AM (#894922) Journal

        So if you get creative with the hiding and showing of elements, then you can do a full blown calendar.

        I'd like to see a demo of this covering multiple years without needing to reload the page.

        • (Score: 0) by Anonymous Coward on Tuesday September 17 2019, @04:47AM

          by Anonymous Coward on Tuesday September 17 2019, @04:47AM (#894997)

          Uhh, just stuff more elements in there? All the text can be labels and all the dates radios, then affect visibility based on year and month selection. Yes, it will be unwieldy, very unwieldy, but that doesn't mean impossible.

          After all, you could code a browser or OS in Brainfuck; that doesn't mean it will be readable or particularly fun to do, but it is possible. Same goes for HTML with CSS, especially CSS3: just because there may be a better language for your project, doesn't mean other languages can't do the same thing.

    • (Score: 0) by Anonymous Coward on Tuesday September 17 2019, @12:06AM (1 child)

      by Anonymous Coward on Tuesday September 17 2019, @12:06AM (#894902)

      If you look at the examples of pure HTML/CSS calendars, they use really sophisticated CSS tricks. e.g. https://codemyui.com/pure-css-calendar-widget/ [codemyui.com]

      But the important point is that the number of websites that actually need Javascript is incredibly small. Shops, blogs, discussion boards of all kinds, movie sites, music sites, news sites - they don't need it. Sure it would be awkward to implement something like Google Docs or Etherpad in pure HTML and CSS - if nothing else, you lose the autosave feature. So that's an exception. But it's a rare one.

      • (Score: 2) by Pino P on Tuesday September 17 2019, @01:00AM

        by Pino P (4721) on Tuesday September 17 2019, @01:00AM (#894926) Journal

        Shops, blogs, discussion boards of all kinds, movie sites, music sites, news sites - they don't need it.

        As for shops, the last time I wrote mark-up for a brand new shop site was a decade or so ago, when people were complaining at me for not supporting IE 7.

        As for discussion boards, I've used discussion boards without script (such as phpBB) and discussion boards with script (such as Discourse), and I'm curious about how to implement some features that Discourse has and phpBB lacks without script. How does a discussion board notify the user of a reply that someone else has posted since the last page load? How does a discussion board offer live preview of the translation from BBCode or Markdown to HTML, or would the user have to submit the form using the Preview button to update the preview? How does a discussion board let a user track how far into a thread the user has scrolled? I guess that's sort of like the autosave feature of Google Docs though.

        As for movie sites, do you mean a review site or an actual subscription video on demand service?

  • (Score: 2) by vux984 on Monday September 16 2019, @11:00PM (5 children)

    by vux984 (5045) on Monday September 16 2019, @11:00PM (#894865)

    It is a common misconception that JavaScript is required for any sort of real application

    Can CSS + HTML sort the words entered into an input box? Tell you how many words there are. How many letters in total. How many words were repeated. How many letters per word (average, mean, and mode).
    Can CSS + HTML compute the length of the hypotenuse of a right triangle given height and base? The inner angles?
    Can CSS + HTML verify the dates in two date fields are properly formatted and also that the 1st date precedes the 2nd? Limited to a two week span.

    Can it be done remotely efficiently or intelligently?

    I think that every web developer should be forced to access their pages through an old 56k modem!

    I think web developers should be forced to test the access of their pages on the lowest end systems they are targeting; that's good policy.
    But I recently worked on a web application where the target user would have an i5 CPU and 8GB RAM with at and HD screen resolution or better and it requires a modern release browser (current iteration of Edge/Firefox/Chrome/Safari are supported).
    It wouldn't make sense to use it on $50 used android on bad cell connection; so we wouldn't test that.

    I have also worked on projects specifically where being able to support a user with a dodgy cell connection WAS a consideration, and we built and tested to that.
    But the idea that every site on the internet needs to cater to the lowest denominator is missing the point.

    Websites, like video games are generally targeted to pre-determined baseline system(s). At one point supporting Netscape 4 and IE 3.0 on MacOS7.3 and Windows 98 was important. Now, for most sites, it's NOT.

    • (Score: 3, Insightful) by barbara hudson on Tuesday September 17 2019, @12:03AM (4 children)

      by barbara hudson (6443) <barbara.Jane.hudson@icloud.com> on Tuesday September 17 2019, @12:03AM (#894900) Journal
      My OS can do all that out of the box without a web browser. If yours can't, you're doing something wrong. And if I had a need to do any of that repetitively, I'd just stuff it in a script.

      The calculator in my phone can do square and cube roots, as well as the full tan/arc tan/coding/whatever, no web browser needed.

      The activity app can tell me at a glance whether any two dates are x number of days apart, so I won't even need to look at my laptop. wc gives me the number of words and lines, a simple regex splits the word list into letters, run through sort, then a one-liner to get the total for each letter. So anything you can do on the web app I can do on my laptop Wii's web browser.

      Same as anyone else who cares to set up their computer to do similarly silly things.

      Web browsers can disappear tomorrow and the world won't stop. There's absolutely nothing a web browser can do that can't be done without one, except run malware.

      --
      SoylentNews is social media. Says so right in the slogan. Soylentnews is people, not tech.
      • (Score: 2) by Pino P on Tuesday September 17 2019, @01:13AM

        by Pino P (4721) on Tuesday September 17 2019, @01:13AM (#894930) Journal

        My OS can do all that out of the box without a web browser. If yours can't, you're doing something wrong. And if I had a need to do any of that repetitively, I'd just stuff it in a script.

        As of 2019, the web browser with plurality usage share in the United States (my home country and SN's) is Safari for iOS (and other browsers for iOS using the same WebKit engine). iOS isn't made for end user scripting. As far as I'm aware, scripting is considered a "truck" feature in the late Steve Jobs's analogy [macworld.com]. Swift Playgrounds exists as a rudimentary scripting environment, but last I checked, Swift Playgrounds was made for iPad, not for iPhone. So this means a lot of people are "doing something wrong" by this metric, and many of them could be your customers.

      • (Score: 3, Insightful) by vux984 on Tuesday September 17 2019, @04:08PM (2 children)

        by vux984 (5045) on Tuesday September 17 2019, @04:08PM (#895224)

        facepalm

        I'm not suggesting you need a webapp to calculate tangents. Do you really think anyone here would suggest that?

        I'm suggesting a webapp that does something useful might need to calculate tangents as part of its actual functionality; and that pure HTML+CSS while great for what it is, is not sufficient for a proper application. Those were not examples of applications those were examples of tiny bits of functionality that an application might need.

        An app that lets you plan a route on a map interactively on a map might report all kinds of route information, distance, elevation changes, maximum incline. It might let you drag points around. It might show hover information about the point under the cursor (elevation, terrain, long+lat, points-of-interest tag info, etc. Save the route; share it with your run/cycle/hike buddies, coordinate meeting up. And record your metrics while you complete it.

        There's absolutely nothing a web browser can do that can't be done without one, except run malware.

        Deliver the same above interactive route planning app to androids, linux, windows, macs, ios. Run without additional local installation or permission steps, and inherently always be running the current version.

        There's not much if anything that HAS to be a web-browser application; but web delivered applications simplify a lot of issues with deploying and maintaining and updating traditional applications. And web delivered applications will need more functionality than HTML + CSS provide.

        • (Score: 1, Interesting) by Anonymous Coward on Tuesday September 17 2019, @08:40PM (1 child)

          by Anonymous Coward on Tuesday September 17 2019, @08:40PM (#895352)

          .tan {
              --tan-term1: var(--angle);
              --tan-term2: calc((1/3) * var(--angle) * var(--angle) * var(--angle));
              --tan-term3: calc((2 / 15) * var(--angle) * var(--angle) * var(--angle) * var(--angle) * var(--angle));
              --tan-term4: calc((17/315) * var(--angle) * var(--angle) * var(--angle) * var(--angle) * var(--angle) * var(--angle) * var(--angle));
              --tan: calc(var(--tan-term1) + var(--tan-term2) + var(--tan-term3) + var(--tan-term4));
          }

          The fact that people here only seem to claim things can't be done due to their own incredulity is fascinating. HTML\CSS is very powerful, the fact you don't use that power doesn't change that.

          • (Score: 2) by vux984 on Monday September 23 2019, @04:21AM

            by vux984 (5045) on Monday September 23 2019, @04:21AM (#897409)

            The fact that people here only seem to claim things can't be done due to their own incredulity is fascinating.

            Meh, even when I'd posted it, i already had a table lookup solution in my head. (much like how kids did trig before calculators in the 60s... using the sin/cos/tan chart ).

            Second, to do this, may be interesting on an academic level; but anyone suggesting ACTUALLY doing this; or that thinks its a GOOD IDEA to do this needs to have their head examined.

            HTML\CSS is very powerful, the fact you don't use that power doesn't change that.

            Magic the Gathering is Turing Complete. The fact that you don't write software in it doesn't change that. But it also doesn't make it a good idea.

  • (Score: 2, Insightful) by fustakrakich on Tuesday September 17 2019, @01:49AM (1 child)

    by fustakrakich (6150) on Tuesday September 17 2019, @01:49AM (#894947) Journal

    I think that every web developer should be forced to access their pages through an old 56k modem!

    On a 486...SX! And 4meg of RAM, I'm being generous.

    --
    La politica e i criminali sono la stessa cosa..
    • (Score: 0) by Anonymous Coward on Tuesday September 17 2019, @02:45AM

      by Anonymous Coward on Tuesday September 17 2019, @02:45AM (#894965)

      I think the web developer's BOSS should see it that way...

  • (Score: 0) by Anonymous Coward on Tuesday September 17 2019, @01:53PM

    by Anonymous Coward on Tuesday September 17 2019, @01:53PM (#895138)

    Very curious what you think about an application that I wrote in JavaScript (and HTML, CSS, SVG). It's a calculator that finds optimal real world resistor values that create a voltage divider closest to a certain user-specified ratio. https://slugrustle.github.io/voltage_divider.html [github.io]

    Originally, I had written this as a command line C++ application, but I wanted to share it with people at work. I decided on the browser + JavaScript because everyone at work has a browser and knows how to open it. Not everyone is as familiar with the command line, and I had a lot of trouble finding a lightweight GUI framework for C++.

    JavaScript + HTML + CSS + SVG worked quite well for this. The program is a single .html file with all code and graphics inlined. It works without an internet connection.