i absolutely hate how the modern web just fails to load if one has javascript turned off. i, as a user, should be able to switch off javascript and have the site work exactly as it does with javascript turned on. it’s not a hard concept, people.

but you ask candidates to explain “graceful degradation” and they’ll sit and look at you with a blank stare.

  • Phoenixz@lemmy.ca
    link
    fedilink
    English
    arrow-up
    0
    ·
    4 months ago

    Ibuild pretty feature heavy CMS type sites, and though I always try to go HTML only first (I’m quite old school still), it’s almost impossible to escape JavaScript

    Having said that, the entire “my website won’t even show anything on the landing page without JavaScript” should die a quick death already

  • python@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    4 months ago

    I only figured this out like, a month ago! I only became a frontend dev when I got shifted into a new team at work, so I came in with zero prior knowledge and have been using exclusively React and Typescript since Day 1. Didn’t even know how to add a css class to something or what tags beside <div> html has until I started a personal project, ran into performance issues (while hosting it in a shitty aws free tier micro t2 lol) and started investigating why my code loads 3MB of Javascript every time I refresh the page.

    I’m working on getting better at it in my personal project, might even try kicking React out entirely and seeing whether just Laravel Blade + Livewire already does everything I need. No way that I’m rocking the boat at work tho.

  • Possibly linux@lemmy.zip
    link
    fedilink
    English
    arrow-up
    0
    ·
    4 months ago

    JavaScript is needed to actually build anything useful. It is way easier to maintain and when done properly it can be very fast to load and use.

    The problem with today’s web is that pages are extremely inefficient and bloated. You can keep the same UI just don’t try to use every framework and library under the sun. Also it would be nice if people actually formated assets properly instead of using tons of large images and other assets.

    • Mose13@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      4 months ago

      People get so mad about JavaScript then load a dozen 10mb unoptimized image files.

    • the_wiz@feddit.org
      link
      fedilink
      English
      arrow-up
      0
      ·
      4 months ago

      JavaScript is needed to actually build anything useful

      Tell this to the people who build things you would call today a “Webapp” with CGI written in C.

      • NigelFrobisher@aussie.zone
        link
        fedilink
        English
        arrow-up
        0
        ·
        4 months ago

        So many basic pages are still done as an SPA when they’d work fine as a postback form. It’s infuriating, but web development is rife with magic hammers.

    • Frezik@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      0
      ·
      4 months ago

      JavaScript is needed to actually build anything useful

      Not even close. I wrote a management system for the keyfobs at my makerspace. I had some JavaScript in there previously for things like loading up logs with pagination over ajax calls or searching for members by name. I took all that out and made it straight server side HTML. It’s fast, takes minimal browser memory, and the back button works with zero fuss.

      Just try making an application that way sometime. Yes, you can find places for targeted use of JavaScript, but every web dev should at least try making a project without it.

      • tomenzgg@midwest.social
        link
        fedilink
        English
        arrow-up
        0
        ·
        4 months ago

        It’s not the bulk of your point (of which I agree with) but your mention of the back button reminded me how much I despise – sometimes above everything else – how much these sites override basic functionality of the browser, overriding inbuilt history navigation, screwing up Ctrl click behaviors, stealing my right-click menu or default key bindings.

        There’s a lot of reasons one might not want to use TikTok but the reason that stops me before even having to consider other reasons (but I can’t really explain to most people) is that it’s a site designed without any really respect or regard for the user.

        Alt+d doesn’t work and Ctrl+l pops up some modal about logging in. I can’t open any of the recommended videos in a new tab because they clearly must’ve just done them as onclicks and not real anchor tags so right clicking doesn’t give me the option and neither does Ctrl clicking (which – also – that’s…got to be an accessibility violation, right?). And more than half the time the full page doesn’t even load because it’s such a strangle of resources that it needs me to click a button on the page because it wasn’t able to load the videos listing of an account in time.

        The whole thing is just a nightmare in terms of design and primarily not even in terms of inefficiency but direct hostility to UX. Absolute garbage.

    • Kissaki@feddit.org
      link
      fedilink
      English
      arrow-up
      0
      ·
      4 months ago

      I’m sure you have something different in mind than me when you say JavaScript is way easier to maintain.

  • rdri@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    4 months ago

    i, as a user, should be able to switch off javascript

    Webdevs don’t care. They were vibe coding even before AI became a thing. It’s my personal opinion that they should not deserve to be called “developers”.

  • Jimmycrackcrack@lemmy.ml
    link
    fedilink
    English
    arrow-up
    0
    ·
    4 months ago

    I don’t know anything about web development but, is it really fair to say it should work exactly the same with JavaScript turned off? If that were achievable why would it be there in the first place? I assume the graceful degradation concept is supposed to be that as you strip away more and more layers of additional functionality, the core functions remain or at least some kind of explanation is given to the user why things don’t work.

    • Frezik@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      0
      ·
      4 months ago

      As a web dev, I’ll say that yes, it is achievable. The problem isn’t what’s possible, but that we’ve trained new frontend devs in certain ways and given them certain tools. Those tools are being used in places they shouldn’t, and those same new frontend devs are failing to learn the fundamentals of HTTP and HTML.

      React, for example, is a JavaScript framework that’s become incredibly popular in recent years. It’s meant for “single page applications”. I once made a control panel for a vacuum former with it, where you could turn on zones of heating and get the temperature updated in real time. You’re not expected to navigate away from that page while you’re using it. I think this is a good place to use React, though you could make the argument that it should be a native GUI app. (I’ll say that it isn’t that important; this thing runs fine on a Raspberry Pi 3, which is the target platform).

      React is not a good option for an ecommerce site. You want to click on a product to check out its details. That means you’re going between very different views (pages) a lot. React increases complexity with no clear gain. An argument can be made for the address/payment/finalization steps. The money people like that because there’s a strong correlation between streamlining checkout and how often cash ends up in their hands.

      A lot of those sites use React, anyway, for everything. Why? Because we’ve trained a bunch of new frontend devs so much on it that they have no idea how to make a site without React. This overspecialization has been detrimental.

      • Mose13@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        4 months ago

        I’m a full time React and React Native developer. Imo, the frustrations with react are when you server side render. React without SSR is much simpler. But you are 100% right about picking the technology that meets your project’s requirements.

        However, let me play devils advocate. Why do you need to SSR your e-commerce site? To optimize your SEO? Seems to me that SEO lately is a lie we’re being sold to make it easier for LLMs to chew through the entire internet, including your SEO e-commerce site. Imo, search engines have stopped serving the consumer. If we forget the SEO component for a second, you could build a killer e-commerce site that uses React and deliver a great user experience. If this is all about SEO, then I’m sure there is lots of garbage we could inject into our projects that would boost SEO. We could add LLM written top 10 articles to a fake blog on our site that nobody actually wants to read, and boost our Google ranking.

        • Frezik@lemmy.blahaj.zone
          link
          fedilink
          English
          arrow-up
          0
          ·
          4 months ago

          It has nothing to do with SEO. We do server side rendering because it’s the simplest thing that works.

    • ElectricMachman@lemmy.sdf.org
      link
      fedilink
      English
      arrow-up
      0
      ·
      4 months ago

      People do stuff in JavaScript that you really don’t need JavaScript for. You don’t need JS to display a store listing, for instance. Or a news page, or documentation, or even a search engine

      • Jimmycrackcrack@lemmy.ml
        link
        fedilink
        English
        arrow-up
        0
        ·
        4 months ago

        Ok, I’m seeing this a lot and I get it, and despite my lack of expertise in the field I can sympathize with the sentiment. Perhaps those replies are answering more in the spirit of the post than the letter.

        It’s just that the title asked if no one knew what this ‘graceful degradation’ concept was anymore and the text used the example specifically that the page should be exactly the same with or without JavaScript switched on which, without trying to be facetious, sounded kind of logically impossible.

  • baggachipz@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    0
    ·
    4 months ago

    Blame the ui frameworks like react for this. It’s normalized a large cross-section of devs not learning anything about how a server works. They’ve essentially grown up with a calculator without ever having to learn long division.

    • jimmy90@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      4 months ago

      PE from server rendering only to a full interactive SPA in the browser is really not trivial both for frameworks and app devs

      there are a handful of frameworks that support it fairly ergonomically now but it’s a discipline that takes time and effort

      also disabling javascript is a tiny minority use case

    • Possibly linux@lemmy.zip
      link
      fedilink
      English
      arrow-up
      0
      ·
      4 months ago

      Not all frameworks are bad

      The problem is the devs/owners not understanding basic fundamentals. They could see a major financial benefit if they make the page snappy and light but apparently no one at these companies realizes that.

  • tal@lemmy.today
    link
    fedilink
    English
    arrow-up
    0
    ·
    4 months ago

    Not even possible to reply to this post using the Lemmy Web UI without having Javascript enabled; the reply button doesn’t function without Javascript.

    • Venia Silente@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      0
      ·
      4 months ago

      It’s impressive that for a technology that’s supposed to be better than Mastodon (bloated) or Reddit (ass-corporate), Lemmy still relies on the same basic evils.

  • mobotsar@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    4 months ago

    To balance it out, I made it so that my web pages fail to load if JavaScript is turned on. Yes, really.

    Okay, I guess technically it shows a message that says “Turn off JS, dummy!”, but it’s the same in spirit.

  • Korne127@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    4 months ago

    I, as a user, should be able to switch off javascript and have the site work exactly as it does with javascript turned on.

    I mean… many websites rely on JavaScript, so it’s kind of obvious that they don’t work without it. If it would work without JS in the first place, the website wouldn’t need to embed any JS code.

    • katy ✨@piefed.blahaj.zoneOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      4 months ago

      many websites rely on JavaScript,

      which is the problem that most people don’t understand the concept of graceful degradation

    • Azzu@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      0
      ·
      4 months ago

      There’s a difference between “wouldn’t work” and “wouldn’t work as nicely”. That’s what this post is about :D Most websites would still work in the same basic way without js.

      • Kazumara@discuss.tchncs.de
        link
        fedilink
        English
        arrow-up
        0
        ·
        4 months ago

        OP really muddled the waters by writing:

        exactly as it does with javascript turned on

        That’s obviously impossible and wouldn’t be degraded.

          • Kazumara@discuss.tchncs.de
            link
            fedilink
            English
            arrow-up
            0
            ·
            4 months ago

            It’s either exactly the same, or it’s gracefully degraded. You’re asking for two opposite things at once.

            For what it’s worth I support the notion that fundamental functionality should be supported without Javascript, with good old form submissions.

            But I also recognise that you can’t get the exact same behaviour without javascript initiated background GETs and POSTs. Easy example: A scrollable map that streams in chunks as you move it.

      • Possibly linux@lemmy.zip
        link
        fedilink
        English
        arrow-up
        0
        ·
        4 months ago

        Why would someone spend tons of time on something that isn’t needed? Only a few people even know how to turn off JavaScript and chances are they will just turn it back on since nothing works.

    • MonkderVierte@lemmy.zip
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      4 months ago

      so it’s kind of obvious that they don’t work without it.

      Uhm, the web is to share content, not to play JS. That’s what graceful degradation is for: the primary usecase should still work, even if the secondary or tertiary doesn’t.

      • Korne127@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        edit-2
        4 months ago

        Uhm, the web is to share content, not to play JS

        The web doesn’t have a single unified purpose. Even if I hate it as a programming language, JavaScript if the basis almost all client-side browser operations build upon.

        Sure, a simple website which just contains information works without it, but if you design a website in which the client does anything interactively and not everything should be processed server-side, it’s not really possible. No matter if you’re talking about a web game, something like Google Earth or an in-browser editor.

    • Björn@swg-empire.de
      link
      fedilink
      English
      arrow-up
      0
      ·
      4 months ago

      Most websites out there could work fine without JavaScript. They rely on it because they can’t be bothered to be better.

      • Possibly linux@lemmy.zip
        link
        fedilink
        English
        arrow-up
        0
        ·
        edit-2
        4 months ago

        Have you ever tried building a modern page without JavaScript.

        You can do a lot of things with HTML5 and CSS. It just is very complicated and painful. It isn’t intuitive and the behavior will vary across browsers. What could be a little JavaScript turns into a ton of write only CSS.

        • Björn@swg-empire.de
          link
          fedilink
          English
          arrow-up
          0
          ·
          4 months ago

          Yes, that’s my job.

          The point isn’t to emulate the JavaScript functionality somehow. The point is to simply fetch the desired information as a new page load when necessary. The page should work in lynx.

    • adarza@lemmy.ca
      link
      fedilink
      English
      arrow-up
      0
      ·
      4 months ago

      website wouldn’t need to embed any JS code.

      other than the 20 trackers and ad scripts.

  • Lena@gregtech.eu
    link
    fedilink
    English
    arrow-up
    0
    ·
    4 months ago

    Fair, some websites do need JavaScript though. Such as webapps. Could they be server-side rendered?

      • PeriodicallyPedantic@lemmy.ca
        link
        fedilink
        English
        arrow-up
        0
        ·
        4 months ago

        They know ssr is a thing which is why they used that term. But ssr produces a static page or static component, where webapps often require some level of interactivity for their basic functionality, such as reacting to server events. They’re asking if that can be achieved with ssr

    • candyman337@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      4 months ago

      Depending on the web app, the real solution would be a much more simplified JavaScript free version

    • memfree@piefed.social
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      4 months ago

      This is correct. Web dev is told to make sure ads load before content. They don’t want users that don’t generate profits.

      • Mose13@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        edit-2
        4 months ago

        So in this example, what’s the underling issue, shitty business requirements or JavaScript?

            • Venia Silente@lemmy.dbzer0.com
              link
              fedilink
              English
              arrow-up
              0
              ·
              4 months ago

              Just because there are other ways to serve you ads does not at all mean we should not be able to not only stop at least one, but also the one which is most dangerous since it literally allows for RCE on all clients. by design.

              • Mose13@lemmy.world
                link
                fedilink
                English
                arrow-up
                0
                ·
                edit-2
                4 months ago

                The browser is supposed to be a sandbox environment for RCE. That’s why the sandbox part is important. Maybe instead of removing the RCE, we can lock down the sandbox better and reduce the amount of information advertisers can collect.

                If you remove code execution in the browser, then many websites will need to ship desktop apps instead. So now you’ve bypassed the browser sandbox altogether and that application can do much more damage.

                I’m not arguing that all websites need to execute in the browser, but without code execution in the browser, you remove a whole class of apps and the web becomes much less useful.

                Edit: calling it RCE is also kinda obnoxious because at that point you might as well call everything RCE. By that definition, if I push a docker image update, do I have RCE inside any container pulling that image? If there’s a way to break out of docker or web browser sandboxing, by all means call it RCE, but this is not that.

                • Venia Silente@lemmy.dbzer0.com
                  link
                  fedilink
                  English
                  arrow-up
                  0
                  ·
                  4 months ago

                  Maybe instead of removing the RCE, we can lock down the sandbox better and reduce the amount of information advertisers can collect.

                  By all means but then someone do it, because it’s 2025 and even Firefox sends all this information that is absolutely not needed to show a webpage. It’s at least 25 years late by this point.

                  If you remove code execution in the browser, then many websites will need to ship desktop apps instead.

                  Which in quite more than just some cases would be good, precisely because some things should be native programs instead of requiring that the web browser basically provides all the tasks of the OS.

  • ExtremeDullard@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    0
    ·
    4 months ago

    Funny, from my standpoint, more functional JavaScript almost always feels like service degradation - as in, the more I block, the better and the faster the website runs.

    • Pika@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      4 months ago

      personally I think this is mostly due to for some reason people tend to give up on visiting a website if it takes more than a second or two to load(guilty as charged though), so instead they load a mostly blank page (which gives the sign that its loading) and then use javascript to load the rest of the content in.

      that and fucking ads galore

      • ExtremeDullard@lemmy.sdf.org
        link
        fedilink
        English
        arrow-up
        0
        ·
        edit-2
        4 months ago

        that and fucking ads galore

        And trackers.

        And Javascript that give you the time in the page, as if you didn’t have a clock on your desktop.
        And Javascript that give you a fake chat window to talk to a shitty AI nobody wants in the bottom-right corner.
        And Javascript to annoy you with GDPR shit everybody absent-mindedly clicks away anyway.
        And Javascript to inform you that the site uses cookies, as if it mattered since it won’t work without cookies.
        And Javascript that nags you for a subscription or stops you scrolling to force you to create an account.

        And of course, all that is done by loading megabytes and megabytes of shit recursively from a kajillion nested addresses because web “developers” couldn’t code tight code if their lives depended on it. All they do is import pre-chewed shit that acts as trojans for big data players to plant more trackers and more ads in your browser, just to serve up barf people by and large don’t give a shit about.

  • scarabic@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    4 months ago

    You’re correct, and I’m going to explain how this happens. I’m not justifying that it happens, just explaining it.

    It isn’t that no one knows what graceful degradation is anymore. It’s that they don’t try to serve every browser that’s existed since the beginning of time.

    When you develop software, you have to make some choices about what clients you’re going to support, because you then need to test for all those clients to ensure you haven’t broken their experience.

    With ever-increasing demands for more and more software delivery to drive ever greater business results, developers want to serve as few clients as possible. And they know exactly what clients their audience use - this is easy to see and log.

    This leads to conversations like: can we drop browser version X? It represents 0.4% of our audience but takes the same 10% of our testing effort as the top browser.”

    And of course the business heads making the demands on their time say yes, because they don’t want to slow down new projects by 10% over 0.4% of TAM. The developers are happy because it’s less work for them and fewer bizarre bugs to deal with from antiquated software.

    Not one person in this picture will fight for your right to turn off JavaScript just because you have some philosophy against it. It’s really no longer the “scripting language for animations and interactivity” on top of HTML like it used to be. It’s the entire application now. 🤷‍♂️

    If it helps you to blame the greedy corporate masters who want to squeeze more productivity out of their engineering group, then think that. It’s true. But it’s also true that engineers don’t want to work with yesteryear’s tech or obscure client cases, because that experience isn’t valuable for their career.

    • rottingleaf@lemmy.worldBanned
      link
      fedilink
      English
      arrow-up
      0
      ·
      4 months ago

      This has to be fixed though. I don’t know, how, but it’s an economic situation bringing enormous damage every moment.

      And most of people it affects are, like me, in countries where real political activism is impossible.

      This is the next thing that should be somehow resolved like child labor, 8-hour workdays, women’s voting rights and lead paint. Interoperability and non-adversarial standards of the global network.

      • Shanmugha@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        4 months ago

        What should be fixed is people. The above described logic is true, it does really happen, and behind it is the idiot desire: to get more money. Not to make a better thing, not to make someone’s life better, not to build something worthwhile - in other words, nothing that could get me out of bed in the morning. When that’s the kind of desires fueling most companies and societies, all things will be going in all kinds of wrong ways

        • scarabic@lemmy.world
          link
          fedilink
          English
          arrow-up
          0
          ·
          4 months ago

          the idiot desire to get more money

          Yes, but we don’t have to make a total caricature out if it. We all need to prioritize our time. That isn’t evil, or broken, or wrong. That’s just life.

            • scarabic@lemmy.world
              link
              fedilink
              English
              arrow-up
              0
              ·
              4 months ago

              Developers having a narrower list of browsers to support is not ONLY about greed. You say it is NOT about making something that works to improve people’s lives. And I disagree with that.

              You can’t build a good piece of software and try To support every client under the sun since the beginning of time. There is a reasonable point to draw some lines and prioritize.

              So while greed is ONE factor, you seem to be saying it’s the only factor, and that people are stupid and broken for doing this. That’s going too far.

              It’s unrealistic to expect perfection. Today people want comprehensive client support. Tomorrow they will be outraged at some bug. But few realize: you may have to pick between the two. Because having zero bugs is a lot more achievable if you can focus on a small list of current browser clients. That’s just a fact. The next day they will be upset that there are ads in the site, but it may be ad revenue that pays for developers to fix all the bugs for all browser clients under the sun.

              People love to rant online about how NO you should give me EVERYTHING and do it for FREE but this is childish tantruming and has no relationship to reality. Devs are not an endless resource that just gives and gives forever. They are regular people who need to go home at night like anyone else.

              • Shanmugha@lemmy.world
                link
                fedilink
                English
                arrow-up
                0
                ·
                4 months ago

                I am saying it is about greed because it actually is, since I am yet to see a situation where the ultimate filter for supporting/dropping a client is NOT revenue from people using that client, and here I am talking specifically about companies making money on their product, so no open source, subsidised, hobby projects etc.

                Peole love to rant online

                They do, now try to catch precisely me doing this

        • rottingleaf@lemmy.worldBanned
          link
          fedilink
          English
          arrow-up
          0
          ·
          4 months ago

          That can’t be fixed. We can’t wait for a different kind of human (what if it’ll be an artificial psychopath anyway) to fix our current thing.

          So hard to disrupt means of organizing (for associations, unions and such, unofficial) and building electoral systems (for Internet communities even, why not) are needed ; social media gave people a taste of that to lure them before subverting it all, but the idea is good.

          Some sort of a global system. When it’s in place, improvement around will follow.

          • Shanmugha@lemmy.world
            link
            fedilink
            English
            arrow-up
            0
            ·
            4 months ago

            It can be fixed: we can choose to produce less idiots and more caring people. You are right, of course, that it is not the only thing we should be doing

      • scarabic@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        edit-2
        4 months ago

        enormous

        It isn’t though. Thats the exact point. It’s a moderate effort that would prevent infinitesimal damage. That’s just not good math. People have to prioritize their time. If you have a numbers case to make about why the damage is so enormous, make it. That’s what it will take to be convincing: numbers.

        • rottingleaf@lemmy.worldBanned
          link
          fedilink
          English
          arrow-up
          0
          ·
          4 months ago

          It is. It’s like the medieval Sound Toll, you can’t measure it well enough because there are no trade routes between the Baltic and the North Sea other than the Sound, the Kiel channel is not yet a thing.