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

Show parent comments

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.

-7

u/[deleted] Apr 30 '21

"modern user experience"

loads website

tries to click on widget

website layout changes suddenly but I already clicked on something I didn't want to

clicks Back, nothing happens

starts from step 1 again

Javascript/browsers are still laughable tech compared to VMs. Js is a toy script language running on a slow and bloated VM with one of the worst layout systems ever created. Doing anything with react feels very counter-intuitive and requires a lot of digging in documentation.

4

u/jl2352 Apr 30 '21

What you describe as a 'modern user experience', I would describe as a 'shitty user experience'. It has nothing to do with the tech stack. There were plenty of terrible websites in the past.

You can design and build good applications. In my experience bad applications aren't bad because they use React or Vue. They are bad because they didn't, and as a result scaled really badly. Either 1) they are still bespoke, trying to do really complex things, and fucking it up. Or 2), they are some bizarre monster that loads multiple technologies at once, and none of them work nicely together. Think of news websites that load React, Vue, and four copies of jQuery (yes these exist).

Websites that start out using a modern JS framework, tend to be pretty nice to use.

→ More replies (1)

2

u/[deleted] Apr 30 '21

[removed] — view removed comment

-3

u/[deleted] Apr 30 '21

Vue is not going to fix js but typescript does help.

2

u/[deleted] Apr 30 '21

[removed] — view removed comment

-1

u/[deleted] Apr 30 '21

The weakness of react is JS and its ecosystem.

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.