3 ms·
Python is strongly typed. You still have to think about the types. Except now you have to think about them every time you work with the code, not just the fir
by nightski 9y ago
Python is strongly typed. You still have to think about the types. Except now you have to think about them every time you work with the code, not just the first time.
- pmontra 9y agoI work with Python and Ruby (some Elixir.) They are strongly typed in the same way. I hardly think about types. The code just works. The only scenario in which I have to stop and think is when I get some input, for example some JSON. Is that value I have to add to this counter a string or an integer? I can cast it to integer and that's it. To be fair, sometimes an integer gets where there should be a string and boom. Still, I prefer that to having to write types again as I used to when working with C and Java. I fix the code and I don't write tests to check the types of function arguments. Maybe I could accept some type inference, but no more string, int, generics, etc.
- deleted 9y ago[deleted]
- Godel_unicode 9y agoYou have to think about the types for some small pieces of your code where those types matter. That's what hints are for. Python lets you, through type hints, only care about the typing in those small cases where it actually matters, and ignore them the rest of the time.