Remix.run Logo
pansa2 7 months ago

> Can you imagine a developer in any of those languages complaining that "oh, now the code is messy and unreadable because we added explicit types"?

Python used to be described as "executable pseudocode". None of the languages you've listed have ever been considered that easy to read.

Making Python look more like them is therefore a step backwards in terms of cleanliness and readability.

maleldil 7 months ago | parent [-]

> Python used to be described as "executable pseudocode"

And that's never been true once you're past toy examples into real-world programs. I agree that type hints are "ugly" to read, but they make the code much easier to understand. You have to be aware of the types anyway, and it's better to have them explicit in the code than in your head.

You can still have duck typing with Protocols if you like that kind of thing. Explicitly saying what you expect the incoming type to be able to do is much better than reading the code and having to track all the attributes and methods so you know what you can use.