66 comments

[ 5.1 ms ] story [ 130 ms ] thread
(comment deleted)
"If you cannot make a web application work without JS, it doesn’t belong on the web."

Except this often means Electron. Dunno which is worse.

Electron is worse. At least Javascript was designed and meant for the web. The millions of dollars and hours of effort put into getting Javascript to act like C++ and replacing native apps with Chromium wrappers has been a disaster both for programming as a discipline and the end user.

Although I would disagree with the initial premise, too. Javascript has been a part of the web for nearly 30 years now. Pretending it doesn't belong there at this point and ranting about other people finding it useful is just infantile.

It really is more related to Sturgeon's law (90% of everything is crap). My complaints are about that 90%, not the 10% that actually is done well.
I don't get it. Who gets to say which 10 % ain't crap?
Anyone. Sturgeon's Law isn't a rigidly defined, mathematically provable statement of objective fact, it's a science fiction author's subjective defense of the quality of work in their chosen genre relative to the mainstream when told that "90% of science fiction is crap." It isn't even strongly related to the Pareto principle, despite superficial similarities, nor is it necessarily universally applicable. At the very least the specific term of "90%" can be interpreted as "most," and of course "crap" is a matter of opinion and taste.

So if you disagree, fine. It's not like you're disagreeing with gravity or something.

> Offended by the above? Tough shit. The web is for documents.

Meh. Not offended, just bored by the silly maximalism. The web is big enough for all kinds of shit, and is better than anything as a distribution platform. Who is he to say what does and what doesn't belong on the web.

php boomer, web is the new native
This personality type tends to hate PHP as well. This is the asshole who still shows up in PHP threads linking to "A Fractal of Bad Design" and snarking about mysql_query.
Regardless if you feel that the web was made only for documents it has become the only truly cross platform runtime you can always expect users to have installed. That's incredibly valuable. Why would we throw that away?

> Stop dicking around with JS and learn a language that will allow you to develop portable native applications.

A lot of those are not much more "native" than web applications. To be able to install on some platforms like iOS you need to pay and get approval from the platforms owner. On some platforms there are clear security issues with installing random applications.

> Or just pick a platform, whether it’s GNU/Linux & BSD, Windows, macOS, Android, or iOS.

And exclude a lot of people.

(comment deleted)
Sometimes I see people mourn a mythical reality where cross-platform desktop development is simple, easy, and preferred. They lay the blame for stagnation in cross-platform development on the web.

I just don't get it. The web is a sandboxed environment that everyone can run. I can understand hating Electron, but the web? I don't think users these days want to install Netflix or Facebook on their desktops.

People want native applications, but they will not want to pay for it. Cross platforms toolkits suck. There are frameworks for Android/IOS cross platform development like Xamarin and they suck, companies tend to move away from them after some time as more integrations to the platform are desired. Windows no longer even has a proper native toolkit unless you use old Win32/WPF, I hold MAUI or whatever they call it today a joke. Linux has GTK/QT clusterfuck. Try makin non-OSS application for Linux. There isn't even a single Linux target, instead you need to target each distribution to do it properly, there are many, and few users. Clusterfuck. Only MacOS has a decent desktop toolkit.

Electron/Web let's you bypass all this shit, mostly. Also, the only reason why Linux desktop is actually useful to me is those webapps those people hate. It just makes sense to target web first.

I just wish there was more separation of website and webapp in the browsers. Two different things, in my opinion.

> People want native applications

When? You think the average consumer wants to download a facebook app on their laptop? To be negged with updates vs just visiting the site?

I buy that the HN crowd wants native apps.

> People want native applications

I and many others really, really don't. I prefer webapps for almost everything except things that need full access to things like filesystems, hardware, etc.

I want my mail, calendar, chat, videos, etc. to fully live in my browser where I have consistent management of tabs, bookmarks, extensions, logins and so on. I also really, really don't want to install applications unless needed.

> I just wish there was more separation of website and webapp in the browsers

Sure, that might be nice, but it also might create the opportunity for webapps to require being put in the "webapp" pool, and I really like just being able to run them as a website once and then just close the tab.

I think what you are describing is mostly what we already have with PWAs?

> Regardless if you feel that the web was made only for documents it has become the only truly cross platform runtime you can always expect users to have installed. That's incredibly valuable. Why would we throw that away?

That's not much better than "everyone runs Windows" (but is a good way to view this). (And yes, you cover choosing an OS later in the post.)

What happens is that a select few browsers have what's considered at this point the runtime. So you are always leaving people out. Maybe the runtime price tag in itself isn't a problem now, but the hardware might be. The interface. And there will certainly be users who just want to avoid the low-contrast always-animating nature of some sites, for example.

Nowadays to me the environment is pretty much like Microsoft in the late 90s, early 2000s with their Windows+Office monopoly, and cultures that saw no problem is assuming that was available. But now, instead of these two, we're all expected to be running one of the select browsers that implement a recent enough version of the "living standards", and with powerful enough hardware and graphics acceleration.

But still, in some cases it has to be more complicated to make sites incompatible with other browsers and in the absence of javascript. Recently, I think I read something attributing trends in loading and rendering using javascript to the way Google ranks entries in search results.

There are sites which load the content dynamically using javascript, there are even sites where this is done with the content already in the served HTML document, as JSON.

There are sites that blank the viewport until scripts change css rules or class names, or load stylesheets.

The latter is especially noticeable when such a site has absolutely no error checking or fallback and stops on some javascript error, leaving the page "blank".

> That's not much better than "everyone runs Windows"

It's absolutely better. It's open standards based instead of proprietary, all current engines are opensource, there are multiple implementations.

> select few browsers

There are three current engines, and I try https://ladybird.dev/ every now and then. It's gotten pretty good and proves that even with a small team you can write a browser that will work with many sites.

> And there will certainly be users who just want to avoid the low-contrast always-animating nature of some sites, for example.

You could make all of that without JS. I'm not sure why people keep conflating the language with the design decisions the website author took. Just HTML+CSS is enough to make all the badly designed sites you want.

>You could make all of that without JS. I'm not sure why people keep conflating the language with the design decisions the website author took. Just HTML+CSS is enough to make all the badly designed sites you want.

Yup, now days you can make pretty good animation site with out JS! Why are people insisting on using JS to be a criteria to see a web page? Could be that the some big players are using it to fingerprint users?

I like the idea of participating, but when I made my little Hugo-based blog I also liked the idea of presenting equations. Is there any way to do that without MathJax, KaTeX, or similar libraries?
Are `<img>`, SVG, and fonts not enough?
Thanks, but I have no idea. I never tried generating SVG from LaTeX. Others suggested MathML, some tools, and OpenType math fonts, so I'm going to try that route first.
MathML seems to be forgotten. I don't recommend writing it by hand, but you don't need any JS to present it.
If you use a font that supports OpenType maths, you can just put MathML in your HTML and modern browsers will render it.

MathML can be generated from LaTeX with pandoc or latexml.

Thanks folks. Your replies are very helpful. I'll take a look at MathML, pandoc, and LaTeXML. Writing MathML from scratch looks tedious, but pandoc and/or LaTeXML might be just the thing to make a conversion easy.
KaTeX supports server side rendering to an html string. If you do this, the client only needs to load the css component of katex, and not the js component.

I believe MathJax has a similar capability.

> The web is for documents.

It's just de facto not any more, sorry. You can be a maximalist all you want, you're achieving nothing and nobody cares. You're not hip.

Do you know many users of my application care that it doesn't work without JS? Precisely none. My revenue would grow literally 0% if I went through this effort, and I would have a much worse application at the end of it.

Even the part of the web that is all about documents is much better with JS than without. I enjoy reading articles with pictures I can enlarge. I enjoy having wikilinks that open a little preview of the target article on hover. And it's very useful to be able to add documents to a list with a single click. Probably not possible as seamless on the server-side, and I really don't need a server-roundtrip plus repaint just for that.

I remember when all that was done server-side. And I remember having bespoke apps to interact with everything. It was horrible. Yeah, the rant dates the person pretty well - not old enough to remember having to download some platform specific .exe shipping some Java nonsense that somehow depends on having IE6 just to order computer parts from a supplier. Yes, it was a smaller download than just the same supplier's homepage is today, but it was just horrible to work with. I'll take the 60 MB of JS frameworks any day.

> I remember when all that was done server-side. And I remember having bespoke apps to interact with everything. It was horrible.

Exactly. I'm starting to believe that a lot of these HTML only maximalists are newer developers, who think it's some kind of trendy, retro badge of honour to reject JS.

Yes, there are some messy, bloated JS web site these days, but if you think we haven't progressed from web 1.0 I have to question whether you ever actually experienced web 1.0.

>I enjoy reading articles with pictures I can enlarge.

It's so frequent that I click to enlarge and the loaded image is displayed at a smaller, or about the same size due to the formatting around it.

For truly huge images with lots of detail to inspect a zoom and pan interface can be useful, but for most please just give me a link to open the image file directly - I will choose if I want that to happen in the same tab or a new one.

I bet a non-zero amount of your users care whether it takes a few milliseconds or several seconds to load a page on your website.
Yes, let’s split development into code silos where you have to relearn everything on the whims of a few big ecosystems. Don’t forget 6 different native apps to make sure your 2D maze game renders everywhere.

Or you make a decent framework for cross-platform interactivity that’s write once and get back to business.

You keep your native apps. I’ll keep the freedom that platform agnostic code provides.

Electron apps ship in platform-specific runtimes. You're just writing native apps with (arguably unnecessary) extra steps.
> You're just writing native apps with (arguably unnecessary) extra steps

You're definitely writing it in less steps. Nobody would say Electron takes more steps than native GUI development.

Why use electron? All non-server OS:es ship with a standards compliant browser these days. Sure those browsers are built specifically for that platform, but they are already installed
javascript is king.
It really isn’t. Try make a site with just js and no css and html and let me know how it goes. Then try the opposite.
Why is Javascript being good dependent on not using CSS?
Not arguing against JS being “good”

I’m arguing against being King. King of what?

The commenter was obviously not arguing against using HTML? Nobody is arguing that. It's what browsers expect to read to us. It's a vague comment, but then you gave it a metric of "try to make a website without html/css." That's just arbitrary.

The original article is arguing against using JS at all. We all understand that both are necessary, it's maximalists like the author that turn it into some war.

I could obviously use a lightweight framework to make rendering HTML easier with loops and conditionals, but I'm still using HTML. But JS makes that easy for me and no other language does that. That's why JS is king, it runs everywhere and a little bit of it goes a long way.

i wouldn't call html and css programming languages
Agree. And? The comment I replied to didn’t mention programming. I’m a web dev. Take JS away from me and I can still do most of my job. JS can be a great tool. It’s king of nothing.
What exactly is it with javascript that these people don't like? Does it offend them that the web becomes a more dynamic and colorful experience? I don't get it.
At one point, Javascript was awful to write, and to this day is often the cause of awful performance or anti-features on websites. It's not hard to find some way to be mad at it, if you're looking.

It's gotten so much better to write, and most websites manage not to screw things up. But it only takes a few of them to put a bad taste in your mouth.

But don't worry, if there were any alternatives, people would screw them up, too. When WASM really takes off, it's going to be quite fun to watch. Everyone that hates JS will hate WASM even more.

I have not written much JavaScript in my life, but from a user perspective I absolutely hate all the fancy animations and slow transitions. They are super annoying and tiring for me. Just give me the damn website as fast as possible.

And to achieve these cool animations websites have to load a shitton of javascript which makes them even slower.

Some may even be just CSS. I'm still waiting for a way to toggle the CSS ones off for all websites, without breaking them.

These often even look sluggish, but maybe it is a relative thing and some see the prompt movement of UI elements as unpleasant and call the animations "smooth". Or maybe it really takes a very powerful GPU on the right hardware to fully experience animations without feeling annoyed? Or both?

JS is okay to write these days. I enjoy the fact that maps (objects), arrays, and functions are its native data language. But it's still weakly typed, which leads to all sorts of insane confusion during development. Above all, almost all of its libraries and frameworks are highly opinionated, try to monopolize the application architecture, lead to poor performance, and teach completely nontransferable skills that are useful almost nowhere else.

In general, minimizing the amount of JS you write improves all of these issues across the board. A minimum of JS is easy to debug and ridiculously fast.

It offends me that I must use Firefox or one of the WebKit forks instead of w3m, eww, links, elinks or my own program which parses HTML.

It offends me that in order to read a document I also have to grant the author of that document execution privileges on my machine.

It offends me when a page’s images are all blurry, low-resolution images (which would be redownloaded by the Javascript I have disabled).

The World Wide Web is a web of documents. It offends me that is has instead become a consortium of walled gardens.

It appears you're stuck in 99'?
1999 was pretty great! I was running Linux, with a nice huge full-colour display running XFree86. Back then it was Mozilla, not Firefox. I had Emacs. TCP/IP and Ethernet had won. MP3s were common. Streaming existed, albeit the options were pretty poor. I had a CD player in my computer and a DVD player in the den. OTOH, CPU, RAM and hard drives were a lot smaller, slower and more expensive.

Here in 2024, I am running Linux, with a nice huge full-colour display running XOrg (because Wayland is still not ready for primetime). I’m using Firefox. I have Emacs. TCP/IP and Ethernet are still around, although if I want spotty performance there’s always WiFi. FLAC and Ogg Vorbis have mostly replaced MP3s. I can easily watch high-resolution video, which is a definite improvement. Streaming, too, has gotten a lot better. I have a CD/DVD RW drive in my computer. CPU, RAM and storage are a lot larger, faster and cheaper.

It’s not really that different, other than the spyware infesting the web. That pretty much didn’t exist in 1999.

I wouldn’t mind going back to 1999. The software I used had a lot less bloat!

> The World Wide Web is a web of documents.

Sure, and if you want to define it as such you are free to only include documents in that definition. The rest of us will keep using the same protocols for accessing other things too and have another definition of www.

I don’t particularly mind apps running atop the web platform. What I do mind is when what could and should be documents are apps instead.
Accessibility. Some people are actually just here to read. That's what the original standard was for, after all.
When I am on the web to consume information, JS is not required. It can be useful for some data visualization but that's it. This is, of course, not the approach taken by almost all web pages. (Even if you insist on collapsible navigation which is dubious at best, you still don't need JS, CSS is enough. https://codepen.io/raubaca/pen/PZzpVe )

In general, it is a mighty odd notion every random person who can throw up a web page gets to run code on my machine. This shouldn't be a casual thing, sandbox or not.

The donation popup on Wikipedia is not a color I like. "Login to continue reading" and other fake paywalls don't create a more dynamic user experience...and fucking cookie consent forms, don't get me started.

I don't dislike JavaScript. I dislike JavaScript being used to make the web suck. So I have NoScript for when it sucks too much.

The biggest offense to me (as a web developer, even) is the jank of js-rendered websites. This commonly means a blank, or (in slightly better cases) a skeleton page, which then often makes more network calls to get page content, which then *eventually* renders.

The 'build' tooling is terrible too, with layers of build-steps (due to incompatible code module types) that result in excessive script sizes. Due to the nature of Javascript, each byte is more computationally expensive than HTML or CSS.

TLDR: Websites are slower, and the fanciness doesn't add much.

Personally I don't think that the problem is that JS makes the web a more colourful and dynamic experience, but that the vast majority of that colourfulness and dynamism is just not good.

Hijacking the user's scroll, rendering the entire website content on JS at client-side (although the emergence of SSR has made this less of an issue. Who knew that not rendering all the things on the client device makes things better, I'm shocked…) and SPAs more generally (GitHub for example is so jank and annoyingly slow nowadays, it's just irritating), doing things like buttons and links with a `<div>` with an `onClick` instead of using the appropriate markup, et cetera.

Of course, many of these things are exactly opposite to the actual best web development practices. But why, then, is this shite so prevalent‽ It's also bad for things like accessibility, with screen-reader users and such sometimes struggling majorly because of myriads of badly developed web applications. Meanwhile a standard HTML document, with some CSS and maybe some JS for progressive enhancement just works. Of course, I know that many use cases require far more interactivity and dynamism than that, but is it such a big burden to not make the user experience worse with bollocks like reinventing browser scrolling?

A sad thing about the Github situation is that, until some months ago, it was perfectly fine for browsing directory tres and clicking to view files on the web, all that worked without javascript. Now it doesn't, except perhaps for the top-level and its README.

That's a shame, I used that a lot for quick browsing, checking and/or comparison of code in repositories hosted by Github.