5 ms·
Python has some design mistakes (IMO): 1. No "var" or "let" keyword, which requires you to read code, particularly with loops, more carefully 2. No multi-line
by posix_monad 3y ago
Python has some design mistakes (IMO):
1. No "var" or "let" keyword, which requires you to read code, particularly with loops, more carefully
2. No multi-line lambdas, which forces you to move snippets away from their usage and come up with a name for them
3. Emphasis on classes and annotations over free functions, which is partly due to (2) but also the lack of a pipe operator, like in R
4. Modifying arithmetic operators (*=, +=, ++, --, etc...). These try to do too much at once. Use more intermediate variables and parens; it's much clearer.
5. "with" statement is a decent idea, but it should be usable without increasing nesting
- sk11001 3y ago> No multi-line lambdas, which forces you to move snippets away from their usage and come up with a name for them This is a good thing. > Modifying arithmetic operators (*=, +=, ++, --, etc...) ++ and -- aren't a thing in Python.
- btdmaster 3y agoInterestingly enough, you have the syntax required to make them a thing. https://tio.run/##dY/NDoIwDMfve4oeh4hEvBiT3bj4FAuZRUmWsXTDzKefgGRIopcm/49fm9qXf/TmdLYUo9KNc3A1qkZ1YQA3bEHKznReSu5Qt3t4NnrAbAoBJucwG2KeuyoxhJYWZikT@oEMOE985cqyyhJje7dF1h7kAo6bNWOUQIP3v2DxC2RBfJ7k43lLnfE8ZIzlefhSRbGqGN8 https://tio.run/##dY/NDoIwDMfve4oeh4hEvBiT3bj4FAuZRUmWsXTDzK... No postfix inc/dec though.
- ildjarn 3y ago> This is a good thing. Why? Sometimes a mapper or a filter is best split across a few lines but a name adds nothing.