this post was submitted on 30 Jan 2025
211 points (97.7% liked)

Programmer Humor

20215 readers
1785 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
211
submitted 18 hours ago* (last edited 18 hours 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] 3 points 14 hours ago (1 children)

Considering there is typing in the code why is there no switch to enable type checking at runtime? PHP does this with a per file declare(strict_types) - why would python be unable to have either a global or per file flag to enable checks?

[–] [email protected] 10 points 14 hours ago (1 children)

Typing when you need it gives you more freedom over a toggle. You can choose to type some parts of the code while leaving other parts untyped.

For example, if I'm writing a quick and simple Python script I may forgo typing, but when iterating on it I'd go back and add the types I need.

[–] [email protected] 4 points 13 hours ago

This isn't an issue, though. PHP has the same partial typing flexibility. There are ways to solve that issue and even typed PHP still allows union types including mixed which allows any types.