46

Would the web be better off, if there was zero frontend scripting? There would be HTML5 video/audio, but zero client side JS.

Browsers wouldn't understand script tags, they wouldn't have javascript engines, and they wouldn't have to worry about new standards and deprecations.

Browsers would be MUCH more secure, and use way less memory and CPU resources.

What would we really be missing?

If you build less bloated pages, you would not really need ajax calls, page reloads would be cheap. Animated menus do not add anything functionally, and could be done using css as well. Complicated webapps... well maybe those should just be desktop/mobile apps.

Pages would contain less annoying elements, no tracking or crypto mining scripts, no mouse tracking, no exploitative spam alerts.

Why don't we just deprecate JS in the browser, completely?

I think it would be worth it.

Comments
  • 27
    On some points I disagree, because there is one big use case for me. Namely UX and accessibility. User are dumb. For example front-end form-validation saves time.
  • 11
    @Divisionbyzero

    Maybe if there was less convenient time saving for dumb people, they'd learn. 😛
  • 3
    @Alice

    See, with a zero-js twitch, you'd have HTML5 video, but no live chat.

    win-win.
  • 8
    @Alice

    I think if HTML was component-based, and a form submission could just reload a specific target component from the backend, you would rarely need JS.

    I feel like all modern frameworks are bloated solutions, and wrong solutions, to a problem with HTML itself.

    HTML is not modular, it can not be nested and composed.

    Both backend and frontend have tried to solve this with all kinds of scripting, templating languages and composing engines, but I think this should have been a much more central part of HTML itself from the start.

    Of course, there are good reasons for frontend scripting, when you're talking about real web APPS -- things like maps, document editing, drawing, task planners... many of those would be hard to do without some SPA-like functionality.

    But every website these days loads either tons of jQuery plugins or React/Vue/Angular, when there is absolutely zero reason for that website to be a single page application.
  • 7
    While I agree that many websites don't need JavaScript at all, I don't agree that more complex apps should be only desktop apps. One might want to use an application but not want to install it on their computer, because they might not use it that often to justify the lost space.
  • 2
    @bittersweet that's the point. Maybe. Some.
  • 3
    @bittersweet I am not using any js framework at all. Therefore not all websites nowadays are doing it in your way.
  • 1
    Yes, we would be.
  • 1
  • 2
    @Divisionbyzero yeah, but you can never trust it
  • 1
    WASM FTW! (i hope so...)
  • 4
    @AlexDeLarge I agree, we used to have to deal with Java applets, Flash, Silverlight and ActiveX. I'm just longing for a simpler world 😉

    @geaz I'm still on the fence about it. I like the idea of being able to write fullstack in a language other than JS — but I wonder about unforeseen consequences. Because of new features in CSS, we suddenly have to worry about CSS keyloggers and exploits. Because of JS workers, mining scripts can slurp up lots of resources.

    The problem is that browsers went from dumb document retrievers, to the most successful remote code execution platforms there are. A browser is a nicely quarantined trojan, and you have to be extremely careful about what browsers can and can't do.
  • 1
    I enjoyed this read... Got me thinking. In 2002 I had the mentality that js was bad and everything should be done server side... Still think it wasn't that dumb
  • 0
    I'd like to see js dead too but I think it would be replaced with something similar or worse pretty soon and there are good reasons for client site scripts eg live chats.

    @Alice
    I feel the same way. I'm not a webdev or similar but I've seen a f@#€ing nanvigation menu in flash I hate this kind of junk -.-

    I think the web how it is now is inherently flawed. HTML wasn't ment for apps it was ment for pretty pages. PAGES not APPS. I think webapps are nothing else than crutches for the problems in the native world.
    The best solution in my oppinion would be to build OSes to be able to relaiably confine native code and then let the browser download binaries and execute them in a confined context. I know, its not gonna happen any time soon but thats the world I dream of.

    Btw I also don't like that the web is based on textual formats. Why not use binary data structures instead of html? Its faster and smaller. Same with svg. I love the idea of vector images but god please not in xml.
  • 0
    @mmyelf what would you use as an human readable xml replacement ?
    - json
    - yaml
    - sgml
    - ...
  • 1
    @stop
    I wouldn't use something human readable. Its supposed to be interpreted by a browser/rendering engine not by humans. For debuging it could be represented graphically or parsed to xml or whatever

    Ps assuming you're talking about html, svg or simmilar. Of cause there are good applications for xml, json, etc like config files
  • 0
    This can never be done, would take a severe amount of backtracking
  • 4
    imagine Facebook/Twitter/Devrant

    page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40.... 67906 67907 67908

    Also what about lazyloading, graphs, games, apps .... Shoppongcarts?!!?!?

    Removing JS makes you sound like a flat earther, or should i remember you on how the web used to be with shokwave silverlight flash and all that insecure crap?

    I keep my JS any day over that dark age.
  • 1
  • 0
    @bittersweet I see what you mean. But every opportunity, in this case the possibilities which we get with a modern web, comes with possible risks. The question is, do we want to pass on modern web applications, or do we want do take the risks coming with them? If we want to take the risk, is it possible for the common user to reduce the risks? And I don't mean plugins as NoScript. That is nothing a common user is able to use (for example my Mum).
  • 3
    What about loading content on scroll, chat, modals or "complicated" forms where based on user selection the visible part of the for changes. Let's say we have a country select followed by a state select. Sure we could do this with a hell lot of css, but to what point.

    I however get the point, that to much is done using js currently.
  • 1
    @corscheid that was a good read lol
Add Comment