this post was submitted on 04 Jun 2025
1014 points (98.6% liked)

Programmer Humor

23855 readers
2537 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
[–] whaleross@lemmy.world 43 points 2 days ago (3 children)

People that try to do mathematical operations with strings blaming the programming language that had a stated design goal to do its best and try to keep running scripts that make no sense because they realized it would be used by people that have no idea what they are doing. Clearly they were right.

[–] grue@lemmy.world 37 points 2 days ago (1 children)

the programming language that had a stated design goal to do its best and try to keep running scripts that make no sense...

...itself makes no sense. It is wrong and bad that Javascript was ever designed that way in the first place.

[–] whaleross@lemmy.world 22 points 2 days ago (1 children)

It was never intended to run full applications but only the small business scripts and hobbyist homepage stuff that were the thing in the 90s, across inconsistent browsers that were a jungle of hit and miss behaviour where it was preferred that menus keep working even if the mouse effect was not. Anything of scale was expected to be done in Java. Dynamic web pages did not exist and as anything not static was generated server side into a static html file to be rendered on the client.

Anyway, back then it wasn't considered the job of the programming language to hold the hand of the aspiring developer as it is common today. It's not a bad thing that IDE and even compilers and preprocessors try to help you write better code today, but then it simply didn't exist.

JavaScript is from a different time and because it has the hard requirement or backwards compatibility there is no changing it and has not been for thirty years except to add stuff to it.

I think it's just silly to ask the past to keep up with the present. Bad code is not the fault of the language regardless, even though junior devs and even seasoned ones like to think so to protect their ego. I think it is better to accept it, learn from it and roll with it because every single platform and language has their weird quirks anyway.

Signed, old dude that learned programming in 8 bit BASIC and 6502 machine code without an assembler, where code bad enough would freeze your machine that required a cold boot and starting over from your last save that you didn't do.

Executing after undefined behavior is arguably worse than terminating with an exception. A terminated script can't leak data or wreak havoc in other ways.

[–] 0x0@lemmy.zip 11 points 2 days ago (1 children)

it would be used by people that have no idea what they are doing. Clearly

And so let's enable these people?
Let's add AI to the mix while we're at it.

[–] whaleross@lemmy.world 6 points 2 days ago (2 children)

Now that you mention it, it is a bit funny how Lemmy is hating LLMs as a code generation tool while also hating on the interpreter for their own hand typed code not running.

I mean, in both cases it's because the LLM and interpreter do things you wouldn't expect.

[–] 0x0@lemmy.zip 1 points 2 days ago (1 children)
[–] whaleross@lemmy.world 4 points 2 days ago* (last edited 2 days ago) (1 children)

Then you do not do Javascript, because it is an interpreted language.

Edit: or Python, or a command line shell, or any CORS, or databases, or... Well idk really what you do use honestly.

[–] 0x0@lemmy.zip 6 points 2 days ago

Then you do not do Javascript, because it is an interpreted language.

No shit?! Wow... who would've known...

[–] MonkderVierte@lemmy.zip 1 points 2 days ago

There's also Chefkoch and Mozart for that purpose.