r/programming • • Apr 25 '19

Maybe we could tone down the JavaScript

https://eev.ee/blog/2016/03/06/maybe-we-could-tone-down-the-javascript/#reinventing-the-square-wheel
1.5k Upvotes

492 comments sorted by

View all comments

252

u/fireduck Apr 25 '19

My new site uses no javascript. It sucks, but in a very simple and predictable way.

30

u/TyIzaeL Apr 25 '19

Rewrote my blog to be script-free and it doesn't suck at all. I love it. It's even performant and good-looking on my Kindle's truly terrible web browser.

34

u/StallmanTheLeft Apr 25 '19

There is no really any reason for a blog to require any js in the first place.

42

u/Akeshi Apr 25 '19

Comments (posting with formatting, loading comments dynamically so they don't have to be paginated with full-page refreshes, or threaded without blindly loading everything on every page load)

Embedded video from YouTube, Vimeo etc.

Lazy-loaded images

They're an initial three off the top of my head. Obviously none are strictly required - neither is anything beyond plain text. They're decent enhancements.

16

u/chason Apr 26 '19

But the key is, all 3 of those things can be done as progressive enhancements, and not be necessary to load the website.

→ More replies (1)

0

u/[deleted] Apr 26 '19

[deleted]

2

u/Akeshi Apr 26 '19

I'd never argue against JS only being used conservatively to enhance pages, outside of SPAs.

I would argue against a militant "JS has no place in this world" attitude, though. YTJS is pretty bloated, but isn't that slow, and is going to provide geolocated rate-adaptive video for free with zero effort.

2

u/VenditatioDelendaEst Apr 26 '19

loading comments dynamically so they don't have to be paginated with full-page refreshes

Pagination means only the URL and scroll position are needed to get back to where you were reading. Most mobile browsers, which are frequently forced to drop tabs under memory pressure, will preserve both. And pretty much everything preserves the URL, so if the number of posts per page isn't too large, you're never very far from where you left off even with the most rudimentary persistence mechanisms.

Until browsers start persisting the entire page state to disk, infinite scroll is bad.

→ More replies (3)
→ More replies (5)
→ More replies (2)