this post was submitted on 01 Nov 2023
113 points (91.2% liked)

Programmer Humor

19660 readers
465 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] 4 points 1 year ago (2 children)

I may just be an old country ~~lawyer~~ PHP developer... but don't most dynamic languages also support static type checking and general analysis at this point?

[–] [email protected] 11 points 1 year ago

Yes but no. Modern PHP lets you put types in function signatures and it will then attempt to convert your inputs to those types at runtime.

JS/TS and Python don't do this. They have optional type annotations that's treated as syntactic sugar. You can use static checkers against this but if you get an error like "expected string got int" you can still run the code. It won't behave any differently because you have annotations.

[–] tatterdemalion 9 points 1 year ago (1 children)

Yes if you use type annotations. Languages like Python and Typescript end up resorting to "Any" types a lot of the time, which breaks any kind of theorem proving you might have otherwise benefited from.

[–] [email protected] 4 points 1 year ago (1 children)

I know Java developers that are addicted to Object. Hit them over the head with an ensmarttening stick and reject their PRs.

[–] [email protected] 7 points 1 year ago

Java developers aren't allowed to not know better by this point. If they think skipping types is somehow ideologically purer, keep hitting with that stick until you hit deckplate.