1009
JavaScript (lemmy.ml)
you are viewing a single comment's thread
view the rest of the comments
[-] REDACTED@infosec.pub 36 points 2 weeks ago

Imagine doing math with strings and then blaming the language not yourself

[-] zagaberoo@sopuli.xyz 41 points 2 weeks ago

The risk is when it happens unintentionally. The language is bad for hiding such errors by being overly 'helpful' in assuming intent.

[-] FooBarrington@lemmy.world 12 points 2 weeks ago

Sure, but at this point it's your own fault if you don't use Typescript to keep these issues from happening.

[-] jjjalljs@ttrpg.network 23 points 2 weeks ago

"Use a different language" is a common defense of javascript, but kind of a weird one.

[-] FooBarrington@lemmy.world 5 points 2 weeks ago

Not really, considering Typescript only adds static types to JS. It's not a different language, it's an extension.

[-] Quibblekrust@thelemmy.club 8 points 2 weeks ago

Since it needs to be compiled to JavaScript in order to be used, I kind of consider it a different language. Yes, it's a strict superset of JavaScript, but that makes it different.

[-] FooBarrington@lemmy.world 2 points 2 weeks ago* (last edited 2 weeks ago)

That's your prerogative, but it honestly doesn't make sense. Typescript adds almost no functionality to JS (and the few pieces it adds are now considered mistakes that shouldn't be used anymore). It only focuses on adding typing information, and in the future you'll be able to run TS that doesn't use those few added features as JS (see the proposal).

You can also add the TS types as comments in your JS code, which IMO shows that it's not a different language.

[-] gmtom@lemmy.world 14 points 2 weeks ago

The problem is consistency.

this post was submitted on 04 Jun 2025
1009 points (100.0% liked)

Programmer Humor

24317 readers
502 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