this post was submitted on 04 Jun 2025
997 points (98.7% liked)

Programmer Humor

24815 readers
541 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
[–] capybara@lemm.ee 30 points 1 month ago (12 children)

To start off... Using arithmetic operators on strings in combination with integers is a pure skill issue. Let's disregard this.

If you were to use + where one part is a string, it's natural to assume a string appending is desired since + is commonly used as a function for this. On the other hand, - is never used for any string operation. Therefore, it's safe to assume that it relates to actual artihmetics and any strings should therefore be converted to numerical values.

This is an issue with untyped languages. If you don't like it, use typescript. End of story.

[–] Jankatarch@lemmy.world 30 points 1 month ago (11 children)

Instead of trying to make it work, javascript could just say "error." Being untyped doesn't mean you can't have error messages.

[–] capybara@lemm.ee 4 points 1 month ago (4 children)

This is fair enough from an idealistic view. In practice, you don't want your entire website to shit itself because of a potentially insignificant error.

[–] Kacarott@aussie.zone 22 points 1 month ago (1 children)

This is exactly why it should throw an error, to make it incredibly obvious something isn't working correctly so it can be fixed. Otherwise you have wrong logic leading to hard to notice and hard to debug problems in your code

[–] capybara@lemm.ee -2 points 1 month ago (1 children)
[–] TheBeege@lemmy.world 7 points 1 month ago

No. I don't want to transpile. I don't want a bundle. I want a simple site that works in the browser. I want to serve it as a static site. I don't want a build step. I don't want node_modules. I want to code using the language targeted for the platform without any other nonsense.

Javascript is cancer. Fucking left pad?! How the fuck did we let that happen? What is this insane fucking compulsion to have libraries for two lines of code? To need configuration after configuration just to run fucking hello world with types and linking?

No, fuck Typescript. Microsoft owns enough. They own where you store your code. They own your IDE. They might own your operating system. Too much in one place. They don't need to own the language I use, too.

"Let's use a proprietary improvement to fix the standard that should have not sucked in the first place" is why we can't have nice things.

No.

[–] Jankatarch@lemmy.world 10 points 1 month ago (1 children)

In practice runtime errors are a bitch to find and fix.

[–] capybara@lemm.ee 1 points 1 month ago

Fair enough. This is why people prefer typescript

[–] random8847@lemmy.world 7 points 1 month ago (1 children)

I'd rather have my website shit itself than have silent difficult to find errors.

[–] capybara@lemm.ee -5 points 1 month ago

Use typescript

[–] Valmond@lemmy.world 5 points 1 month ago (1 children)

Look! I bought this for free on capybaras website, there's a glitch!

capybara: at least it didn't throw an error.

/ jk 😁

[–] capybara@lemm.ee -3 points 1 month ago

Use typescript if you're paranoid about this

load more comments (6 replies)
load more comments (6 replies)