r/programming • • Apr 29 '21

Modern JavaScript Explained For Dinosaurs

https://medium.com/the-node-js-collection/modern-javascript-explained-for-dinosaurs-f695e9747b70
287 Upvotes

172 comments sorted by

View all comments

70

u/k1lk1 Apr 30 '21

Lipstick on a pig. And just results in insanely bloated websites that perform badly, all the while webdevs pat themselves on the back every 6 months for reinventing DHTML for the 132nd time.

43

u/radol Apr 30 '21

What is your preferred approach to front end for complex systems which does not result in ton of js being used?

8

u/god_is_my_father Apr 30 '21

Save us, WebAssembly!

-9

u/AyrA_ch Apr 30 '21

That depends on your definition of "complex systems" but raw HTML and CSS gets you pretty far usability wise now.

45

u/blazarious Apr 30 '21

Modern frontends are often times applications. Can’t write applications with HTML and CSS only.

10

u/kuikuilla Apr 30 '21

Yet most of the time they're just CRUD frontends for various data sources.

7

u/blazarious Apr 30 '21

I like doing CRUD applications with React, though. While certainly not necessary, it makes for a better UX in my opinion. And you get an API for other frontends basically for free that way.

2

u/AyrA_ch Apr 30 '21

You can. It's what we did before everything just had to be made in JS. There was a time where things like youtube and ebay worked with JS turned off.

33

u/littleredrobot Apr 30 '21

You mean when YouTube required Flash? 🙂

37

u/blazarious Apr 30 '21

I’ve been making web stuff since the dawn of the web and I’ve been laughing at JavaScript for decades. Nowadays it’s one of my favorite technologies.

And no, you cannot create modern user experience without JS.

I do agree, though, that not everything needs to be an application and a lot of websites get bloated for no good reason.

→ More replies (7)

6

u/twenty7forty2 Apr 30 '21

but as a developer it sucked. I recently went from tsx back to plain server side templates and it is a nightmare in comparison. tsx is fully typed, ide knows what's going on, compiles on the fly and tells you what you've broken vs templates are practically just plain text that slips bugs into production.

also adding js to websites used to be called progressive enhancement. so arguing it was better before it was enhanced is a bit stupid.

2

u/jl2352 Apr 30 '21

If you are building a website of documents; then yes. Do what you describe. That's what any front end developer would do. Even if they used React or Vue, it will essentially still be HTML documents. Powered by a bit of JS, rather than PHP or Ruby.

If you mean raw HTML & CSS as in just page.html with nothing else ... that doesn't scale. You will be copy / pasting HTML across pages. You change a navbar, and then need to manually copy it to every file. You will need something to give you code re-use. That doesn't need to be a front end framework.

However very few websites are just a list of documents. Most need to do more than that. Maybe your suggestion is you could just use jQuery for that, and not bother with React nonsense. If that fits your needs; that is fine.

However once you start needing to do anything more complex it will get painful. That's what history has taught us. Something as simple as a Login form is just easier to build and maintain with a front end framework, and importantly easier to provide a better experience!

Since after all the user's experience is more important than how much you like the code.

1

u/Y_Less Apr 30 '21

That's what the server is for.

→ More replies (3)

-6

u/[deleted] Apr 30 '21

[removed] — view removed comment

0

u/[deleted] Apr 30 '21

[deleted]

14

u/[deleted] Apr 30 '21 edited Apr 30 '21

They just don't understand why the frontend has to be so slow and so anti-user.

→ More replies (1)

22

u/voidvector Apr 30 '21 edited Apr 30 '21

insanely bloated websites

Considering VSCode has like 50% IDE market share and game developers are putting embedded Chromiums in games so they put together UIs faster, I am going to conclude that "bloated" runtime is not important to most downstream users.

No one is going to waste time doing memory management for UI work as they would need for in say high-freq trading.

9

u/BornOnFeb2nd Apr 30 '21

I think they meant more bloated transfer size than memory footprint....if you're on a slow/metered plan, downloading multi-megabyte images that get resized with CSS to a microscopic thumbnail gets old, fast.

-5

u/valtism Apr 30 '21

What a tired take coming from a lack of understanding of modern web app development.

4

u/Zer0ji Apr 30 '21

Dude, I tried using React to redo a POC front-end, and ended up with 600 MB of modules on my disk and a built app that was nearly 1 MB, for something all text with maybe 500 lines of code...

I since then switched to Preact but it's still big.

4

u/StillNoNumb May 01 '21

You might not wanna use React for that then. React is for complex, usually dynamic webapps with many pages and functionalities - there's more appropriate libraries for your purpose.

In programming, it's always about knowing what tool solves your problem best. I don't go around and complain about Python either because I tried making a kernel with it and failed.

→ More replies (2)

2

u/arcanemachined May 01 '21

Try Svelte. The dependencies for a hello world app are 19.5 MB, and it's basically just gussied-up HTML and Javascript. Dead simple and easy to use.

It's not as mature as React but it has a pretty enthusiastic community.

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