Stories
Slash Boxes
Comments

SoylentNews is people

posted by martyb on Wednesday September 05 2018, @04:57PM   Printer-friendly
from the less-is-more dept.

Programmer Drew DeVault writes a blog post about conservative web development after poking at a few popular sites and finding that only 8% of the data downloaded among the megabytes of advertisements, scripts, and third-party scripts is actually related to content. This represents several usability problems. After walking through some of the more problematic symptoms he proposes several steps which can remediate the state of the web.

Today I turned off my ad blocker, enabled JavaScript, opened my network monitor, and clicked the first link on Hacker News - a New York Times article. It started by downloading a megabyte of data as it rendered the page over the course of eight full seconds. The page opens with an advertisement 281 pixels tall, placed before even the title of the article. As I scrolled down, more and more requests were made, downloading a total of 2.8 MB of data with 748 HTTP requests. An article was weaved between a grand total of 1419 vertical pixels of ad space, greater than the vertical resolution of my display. Another 153-pixel ad is shown at the bottom, after the article. Four of the ads were identical.

Aside: Opponents to javascript are often wrongfully framed as Luddites. However, I invite readers to connect the dots; see:
Exploiting Speculative Execution (Meltdown/Spectre) via JavaScript
Web cache poisoning just got real: How to fling evil code at victims
Rowhammer.js Is the Most Ingenious Hack I've Ever Seen and
Oh, great, now there's a SECOND remote Rowhammer exploit

[Ed note: SoylentNews is designed to use no Javascript for normal user interactions. (There are a few staff-accessible pages requiring it, such as the Story Editing page.) I don't know of anyone on staff who would seriously consider changing that. When this site was initially rolling out, we actually tested to make sure it would work on a text-only browser (Lynx) and even Mosaic! So, please enjoy your light-weight, performant web pages here!]

[TMB note: Except the "collapse/expand this whole damned thread" button.]


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 fyngyrz on Wednesday September 05 2018, @06:24PM (13 children)

    by fyngyrz (6567) on Wednesday September 05 2018, @06:24PM (#730879) Journal

    TFS states:

    SoylentNews is designed to use no Javascript for normal user interactions. (There are a few staff-accessible pages requiring it, such as the Story Editing page.) I don't know of anyone on staff who would seriously consider changing that.

    I think this is too draconian, frankly.

    For instance, on That Other Site, when you moderate, right by the mod drop down, the remaining number of points is shown, and the entire bloody page doesn't need to reload when you moderate, which would be (and is, here) just a waste of bandwidth and the user's time. That is an entirely benign use of javascript, and as far as I'm concerned, is just the kind of thing that justifies its existence.

    I'd be perfectly okay with javascript used to benefit the users. That's a far cry from the abuses advertisers put it to.

    we actually tested to make sure it would work on a text-only browser (Lynx)

    Lynx... yeah, that's probably going too far at this point in time. And...

    So, please enjoy your light-weight, performant web pages here!

    My mod points example above is a demonstration of how the pages are less performant than they could otherwise be if they did use javascript. So there's that.

    Just my .02

    Starting Score:    1  point
    Moderation   +3  
       Insightful=2, Interesting=1, Disagree=1, Total=4
    Extra 'Insightful' Modifier   0  
    Karma-Bonus Modifier   +1  

    Total Score:   5  
  • (Score: 5, Insightful) by hemocyanin on Wednesday September 05 2018, @07:20PM (6 children)

    by hemocyanin (186) on Wednesday September 05 2018, @07:20PM (#730906) Journal

    Just do all your mods at one time at the end rather than on each item. This way, you save a point if someone has already modded a story to max or min.

    • (Score: 4, Insightful) by fyngyrz on Wednesday September 05 2018, @08:51PM (5 children)

      by fyngyrz (6567) on Wednesday September 05 2018, @08:51PM (#730948) Journal

      Doesn't keep track of how many points I've spent, so it's not as useful as a mod-right here, right-now would be to me, and it still requires two page loads instead of one, (one to mod, one to reload to drive the mods home) so it's 200% of the bandwidth that would otherwise be required. Also, I'd forget sometimes, which may just be a "me-old-man" problem, but it's still an actual problem.

      Mod-now Javascript would be better in these regards. No way around it.

      • (Score: 2) by deimtee on Wednesday September 05 2018, @09:25PM (4 children)

        by deimtee (3272) on Wednesday September 05 2018, @09:25PM (#730963) Journal

        Not a web programmer, so this is a serious question, but wouldn't adding javascript modding code to every comment pretty much negate the reloading bandwidth argument?
        And you're adding it to every page for everyone, not just those modding that page.

        --
        If you cough while drinking cheap red wine it really cleans out your sinuses.
        • (Score: 3, Informative) by tibman on Thursday September 06 2018, @03:52AM (1 child)

          by tibman (134) Subscriber Badge on Thursday September 06 2018, @03:52AM (#731145)

          The js function would only be defined once on the page. Each Moderate button would just call the same defined function. You could slim the page with js by removing the moderate's combo box from every comment (15 select options * number of comments is a lot). Then when clicking moderate you'd get a small modal (or something) where you can select the rating and submit or cancel.

          --
          SN won't survive on lurkers alone. Write comments.
          • (Score: 2) by fyngyrz on Thursday September 06 2018, @05:44AM

            by fyngyrz (6567) on Thursday September 06 2018, @05:44AM (#731179) Journal

            You could slim the page with js by removing the moderate's combo box from every comment

            Or, you could have the javascript dynamically create the drop-downs on the client side as the page is rendered. They could look the same, but work better, take much less bandwidth than embedded, sent-over-the-net drop-downs, not require page reloads at all, and be able to display the current mod point count. All you need is an element with an id per comment, probably just the comment number, or very close to that. Very efficient. Same goes for the visible mod state of the comment itself: easily done, very efficient.

        • (Score: 4, Informative) by fyngyrz on Thursday September 06 2018, @05:33AM (1 child)

          by fyngyrz (6567) on Thursday September 06 2018, @05:33AM (#731177) Journal

          Not a web programmer, so this is a serious question, but wouldn't adding javascript modding code to every comment pretty much negate the reloading bandwidth argument?

          No. It can be done very efficiently.

          • (Score: 0) by Anonymous Coward on Thursday September 06 2018, @07:53PM

            by Anonymous Coward on Thursday September 06 2018, @07:53PM (#731486)

            there's a app for that ... kidding, no, srsly!

  • (Score: 4, Interesting) by DarkMorph on Wednesday September 05 2018, @09:52PM (1 child)

    by DarkMorph (674) on Wednesday September 05 2018, @09:52PM (#730973)
    Let's continue on that line of thinking. The benign usage of JS to update content on the page to avoid page reloads and to conserve a lot of bandwidth.

    It always bothered me that most sites will have commonly consistent elements, like some kind of navigation, header, footer, those sorts of things, and for every (well, most) pages you visit for a site designed this way, you continue to be bombarded with the same collection of markup each page load. Surely there's a better way? Assets like JS or CSS are cached, but not fragments of HTML. Wouldn't it make more sense to keep the user on the same page, loading the common HTML just once, and let JS take care of going from page to page? Make an async call, get data in a JSON, run some logic to present this data on the fly... Yeah, it would completely trash the back/forward buttons since asynchrnous requests don't count as browsing history...

    Oh, wait. There is a way to do this (at least partially, anyway) -- but for some reason the Internet decided it was bad design to use them.

    They're called frames.

    Of course, frames were awfully limiting if used, but it was the only non-JS/AJAX solution to the idea described and rather than evolving, it was left behind in the dust. Unfortunately if you try to get creative with iframes, you will most likely still resort to JS to make the whole thing work.
    • (Score: 3, Informative) by tibman on Thursday September 06 2018, @03:56AM

      by tibman (134) Subscriber Badge on Thursday September 06 2018, @03:56AM (#731148)

      Some js frameworks embed html snippets inside them which makes large portions of the site cacheable by the client browser.

      --
      SN won't survive on lurkers alone. Write comments.
  • (Score: 1, Insightful) by Anonymous Coward on Thursday September 06 2018, @12:29AM (2 children)

    by Anonymous Coward on Thursday September 06 2018, @12:29AM (#731044)

    Disagree. As an AC, I don't participate in moderation, but a registered user should be able to do all things a user does, including moderation, with javascript off. A minor added convenience with javascript may be ok, but it should not be a necessity.

    • (Score: 0) by Anonymous Coward on Thursday September 06 2018, @12:59PM (1 child)

      by Anonymous Coward on Thursday September 06 2018, @12:59PM (#731274)

      Feel free to contribute to the code to enable this

      • (Score: 0) by Anonymous Coward on Thursday September 06 2018, @03:59PM

        by Anonymous Coward on Thursday September 06 2018, @03:59PM (#731352)

        I might but I am allergic to Perl. Anyways, it currently works as I would like, so there is nothing to "enable".

  • (Score: 2) by MichaelDavidCrawford on Thursday September 06 2018, @01:20AM

    by MichaelDavidCrawford (2339) Subscriber Badge <mdcrawford@gmail.com> on Thursday September 06 2018, @01:20AM (#731071) Homepage Journal

    It's the _original_ first-gen iPad running iOS 5 or so.

    The "+" single-post disclosure buttons don't work on it.

    However they "++" thread disclosure buttons work just fine.

    --
    Yes I Have No Bananas. [gofundme.com]