3 ms·
I understand the confusion it may cause to a new Python developer who comes from the mathematical background. Does it cause any problems beyond that? For examp
by _cs2017_ 8y ago
I understand the confusion it may cause to a new Python developer who comes from the mathematical background.
Does it cause any problems beyond that? For example, does it interfere with some elegant patterns, or result in some bug prone code, etc?
FWIW, the single main annoyance I've had with python was its treatment of strings as iterables of single character strings. While not wrong in any obvious theoretical sense, it conflicts with the mental model of many developers (both new and experienced) and has probably caused more bugs than any other feature of Python (and even more ugly type checks to avoid such bugs). When people realized it was a problem and discussed removing this feature, Guido said he had tried but (a) it was too much work and (b) he felt the benefits are too great to give up (https://mail.python.org/pipermail/python-3000/2006-April/000824.html https://mail.python.org/pipermail/python-3000/2006-April/000...).
- zdkl 8y ago> strings as iterables of single character While it makes sense to think of them as sequences, this has bitten me more than I care to admit. OT: Is there a name for things we love to complain about, but wouldn't change?
- falcor84 8y agoYeah, it was a great mind-blown moment for me when I discovered that accessing the first character is idempotent in Python: s[0] == s[0][0][0][0]
- enriquto 8y ago> I understand the confusion it may cause to a new Python developer who comes from the mathematical background. I'm confused mainly because a person with a mathematical background created a language with such an obvious blunder. When I have to use the language (and I do often) I am not confused about string concatenation, I am ashamed of having to use this ridiculous notation.