5 ms·
It might be for some as it's a common misconception that Python does not have strong typing.
by svisser 11y ago
It might be for some as it's a common misconception that Python does not have strong typing.
- masklinn 11y agoThe "misconception" probably comes from "strong typing" being less an objective concept and more an attempt to weaselly state language preferences.
- duaneb 11y agoWell strong vs weak typing is both orthoganal to and predates most of the discussion of static vs dynamic typing. You have to deal with conversions no matter what.
- masklinn 11y ago> Well strong vs weak typing is orthoganal to the discussion of static vs dynamic typing. "strong vs weak" can't be orthogonal to anything because it's meaningless and nonsensical. That's like saying NaN is lower than 5. > Well strong vs weak typing is predates most of the discussion of static vs dynamic typing. [citation required]
- deleted 11y ago[deleted]
- duaneb 11y agoI'm not sure what there is to be confused about. "weak" types mean they may elide into other types implicitly. "strong" types mean that the value will always be interpreted as one (set of) type(s). (really just one type, but that type may be a subtype, so it gets confusing.)
- gaius 11y agoI don't think that's true. What I don't want is my program to blow up at runtime because given some input a function doesn't give me the expected type of output (e.g. maybe I've missed a condition and my function drops out the bottom). OCaml will tell me about this at compile time.
- antod 11y agoI don't think it is so much about it being 'subjective' or 'weaselly'. It is more about type systems sitting on various continuum dimensions rather than having binary descriptions. There are marked differences between where different dynamically typed languages can sit on the strong vs weak dimension. Python and Ruby are closer to the strong end while PHP and Javascript are closer to the weak end. It is a useful real world distinction. eg PHP and Javascript will happily coerce different types (eg strings and ints) together while Python and Ruby will raise type errors.
- afandian 11y agoEven on HN? That was news to me.