this post was submitted on 26 Jan 2023
1 points (100.0% liked)

General Programming Discussion

7810 readers
8 users here now

A general programming discussion community.

Rules:

  1. Be civil.
  2. Please start discussions that spark conversation

Other communities

Systems

Functional Programming

Also related

founded 5 years ago
MODERATORS
 

Sourcehut has No JavaScript as one of it's selling points, so i was wondering why it would be better that way?

you are viewing a single comment's thread
view the rest of the comments
[โ€“] Aarkon@feddit.de 1 points 2 years ago* (last edited 2 years ago) (1 children)

I see your point. On the page that I'm building, the mobile navigation menu is the only usage of Javascript and I think that's reasonable (desktop users are way more likely to disable JS than mobile users, for whom you should optimize anyway in most cases). Of course, there are other use cases where content is really dynamic (e.g. Etherpad), which you just can't tackle with only HTML & CSS.

In my opinion, it's those little things that JS is good at and CSS is (currently) not. JS is a tool, neither more nor less, and like with all tools, it's more important what you do with them than what tool you use.

That's not to say that I'm not in line with you that 95-99% of all JS code in modern web pages is bloat in the best case and acting against the users interest (like by spying on them) in most others, and I'm in no way an apologist for it. Condemning its usage altogether throws the baby out with the bathwater though imho.

Oh, and on performance: JS is pretty optimized today as well. A lot of waiting for modern web pages is due to loading of external resources, which would hardly be any faster if done in C*. In conclusion, we're blaming the language for what people do with it. ๐Ÿ˜‰

* I'm not saying that 3rd party assets are necessary or good, it's just an observation

[โ€“] rysiek@szmer.info 1 points 2 years ago (1 children)

Sure, I think we basically agree.

There are things that are impossible without JS, and there are things that are possible without it but JS is still the better choice for implementing them โ€” as long as it's not the bloated mess, pulling random libraries from a dozen third party services, that we know and "love" from a lot of websites. And as long as there is graceful degradation built-in.

[โ€“] Aarkon@feddit.de 1 points 2 years ago

Absolutely. ๐Ÿ™‚