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

Programmer Humor

19809 readers
250 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
[–] [email protected] 63 points 1 year ago (27 children)
[–] [email protected] 59 points 1 year ago (26 children)

It's making fun of dynamic languages because rather than letting the compiler prove theorems about statically typed code, they... don't.

[–] [email protected] 4 points 1 year ago (4 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?

[–] Solemarc 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.

load more comments (3 replies)
load more comments (24 replies)
load more comments (24 replies)