this post was submitted on 30 Jan 2025
319 points (97.1% liked)

Programmer Humor

24555 readers
2639 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
319
submitted 4 months ago* (last edited 4 months ago) by [email protected] to c/[email protected]
 

Have to add that we work exclusively in strongly-typed languages. Kinda want to see how it plays out, but I can't help but argue with him, so I think I'll just go.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 0 points 4 months ago (13 children)

I recently tried out Python. I had no idea it still doesn't have runtime enforced typing...

I didn't realize that PHP was decades ahead of it.

[–] [email protected] 19 points 4 months ago (3 children)

Python is dynamically strong typed, meaning you don't need to specify any types, but unlike JavaScript you can't just use a string where an int was expected. In that sense it's absolutely runtime enforced typing.

[–] [email protected] 9 points 4 months ago (2 children)

... and yet... it lacks clear and enforced type restrictions which help with clear code contracts. It's certainly better than Javascript but the lack of runtime enforced type checking can force defensive programming in an unnecessary manner.

Your statement isn't strict type checking. It's a restricted form of type coercion. Given how common this feature is in other languages it's weird that pythonistas feel so defensive when discussing the feature. I enjoy strict type checking, but that's my opinion - it makes it a poor choice for the sorts of projects I work on but if it's good for you then enjoy!

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

it lacks clear and enforced type restrictions which help with clear code contracts

Not anymore! Gradual typing is supported by the core language and pyright is a fantastic incremental type checker that you can use both in your editor and in CI.

load more comments (1 replies)
load more comments (1 replies)
load more comments (10 replies)