this post was submitted on 22 Nov 2023
211 points (92.0% liked)

Programmer Humor

19154 readers
2012 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] 55 points 10 months ago (2 children)

I've seen this same thing happen with Python's type hints. Turns out giving an "escape hatch" type for devs who have no clue what the type actually is leads to a lot of useless type hints.

[–] [email protected] 15 points 10 months ago (1 children)
[–] [email protected] 12 points 10 months ago (1 children)
[–] [email protected] 7 points 10 months ago

Laughs in object

[–] [email protected] 4 points 10 months ago

Yeah, it's especially bad, when a library doesn't provide type hints itself. It can be comically difficult to find out what the return type of a function is, because every if-else-branch might have a different return value, so you may need to read the function body in full to figure out what the type might be.

Add to that, that lots of the tooling around type hints isn't as fleshed out / useful as it is in fully typed languages and I can definitely understand why someone might not immediately feel like it's a valuable use of their time.