this post was submitted on 05 May 2025
429 points (98.9% liked)

Programmer Humor

23040 readers
1896 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] LeninOnAPrayer@lemm.ee 56 points 19 hours ago* (last edited 19 hours ago) (5 children)

People give JS a lot of shit. And I do too. But it's meant to continue running and not fail like C code would. It's meant to basically go "yeah, sure I'll fuck with that" and keep trucking.

So you can always make it do stupid shit when you use it a stupid way.

Is this bad? Maybe. Was it the intention of the language? Absolutely.

Typescript fixes a lot of these headaches. But I feel like JS is doing exactly what it was meant to do. Keep trucking even when the programmer asks it to do stupid shit.

If you're using JS and don't understand this then it's your fault and not the languages fault.

Do we all want to live in a world of typedefs as strict as C and have our webpages crash with the slightest unexpected char input? Probably not.

We don't notice all the time JS goes "yeah I can fuck with that" and it works perfectly. We only notice the times it does that and it results in something silly.

TLDR: JS does what it was made to do. And because of that it looks absolutely ridiculous sometimes.

[–] JakenVeina@lemm.ee 6 points 8 hours ago

The REAL problem is that the industry collectively uses JS almost exclusively for shit it was never meant to do. Like you say, it's intended for it to not throw errors and kill your whole web page, because it was only ever intended to be used for minor scripts inside mostly-static HTML and CSS web pages. Then we all turned it into the most-popular language in the world for building GUI applications.

[–] mmddmm@lemm.ee 7 points 13 hours ago

It’s meant to basically go “yeah, sure I’ll fuck with that” and keep trucking.

Yet, it lives in an insulated environment, with plenty of infrastructure to make sure errors do not propagate, with a standard error handling functionality on the spotlight with specialized syntax, and with plenty of situations where it just drops the ball and throws an error.

Nope, not falling for the gaslight. It's a stupid feature that's there because the language was created during a week and the author was trying to juggle the requirement of a rigid and typed semantics that looked like Java with his desire to make a flexible single-typed language that looks like Lisp.

And nobody fixed it, decades later, because everybody keeps repeating your line that the interpreter must always keep on.

[–] leftytighty@slrpnk.net 37 points 19 hours ago

People forget that crashes are a debugging tool indicating an error. Silent errors can be much more dangerous. C and C++ in particular need to be careful not to overwrite random memory for example.

Yes the consequences for JS failures are less severe and so JS can get away with it, but a crash is a way to know your program isn't doing what you thought it was, properly.

It just so happens that JS is used in contexts where nobody really cares, and errors aren't a big deal, cheap and fast wins.

[–] Blackmist@feddit.uk 5 points 14 hours ago

My main issue with JS is you can use it wrong, and it pretends to work, and often looks like it works.

But then shits its pants explosively the second you fall outside that.

[–] wischi@programming.dev 3 points 18 hours ago* (last edited 1 hour ago)

That's not why JS is a big pile of crap. It's because the language was not thought through at the beginning (I don't blame the inventors for that) and because of the web it spread like wildfire and only backwards compatible changes could be made. Even if with all your points in mind the language could be way nicer. My guess is that once wasm/wasi is integrated enough to run websites without JS (dom access, etc.) JS will be like Fortran, Cobol and Telefax - not going away any time soon, but practically obsolete.