this post was submitted on 05 Apr 2024
524 points (94.4% liked)

Programmer Humor

19678 readers
211 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 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 0 points 7 months ago (9 children)

Both are fine tbh. Javascript has come a long way from a decade ago, and mixing in a decent framework like jquery does wonders.

[–] [email protected] 3 points 7 months ago* (last edited 7 months ago) (5 children)

The type system is still really bad, and apparently TypeScript gets mixed with native libraries in common practice, which makes a bad situation worse when something breaks.

Edit: Messed up the name, fixed.

[–] [email protected] 1 points 7 months ago* (last edited 7 months ago) (4 children)

The typing system is just a “quirk”. As long as you understand the (admittedly annoying) exceptions to the way your brain expects typing to work, everything works quite well.

And tbh, transpiled TypeScript libraries can be called from JavaScript as if it was JavaScript... because it is JavaScript. There’s no need to worry about typing unless you’re doing something like passing a string into a function that expects an int, and you’d run into those same problems if the function was originally JavaScript.

Edit: a word

[–] sacredfire 1 points 7 months ago

I personally don’t think that’s the issue with the typing system. With vanilla js if I’m looking at a function that has say four parameters that are not trivial objects like strings but are actually complex (think dependency injection) it’s very difficult for me to know what these objects are other than reading through the code of the function.

Actually, even if the parameters are simple, I’m not sure of that until I look into the function and see what it’s doing. This is a huge pain in the ass most the time, because I just wanna look at the function name its parameters and move on. However, that being said, most of this can be remedied with jsdocs and a good linter/lsp.

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