4 ms·
Is it possible these guys fail to realize people don't use python for its speed? I, for instance, use python because it's an extremely elegant language that all
by SilverSlash 9y ago
Is it possible these guys fail to realize people don't use python for its speed? I, for instance, use python because it's an extremely elegant language that allows me to write short, compact, and succinct code that's incredibly easy to read and is self documenting.
- friendzis 9y agoI do use python, but calling any dynamically typed language self documenting is a huge overstretch. Sure, naming may be structured well, revealing intent, but without formal contracts the code is not self documenting. There is this problem with computers that they perform what they are told to, not what is expected from them. Good naming and structure help closing the gap between expected and actual behavior, but the gap is always there, therefore this is documentation in at most a very broad meaning having very little to do with language in question. Static types, on the other hand, actually document things - at the very least what can be passed and what will be returned. This may not be completely necessary when reading code or even writing code in a well known environment and context that fits into programmer's head, but without formal contract programmer is faced with two choices: trust manual or read and understand ALL the code. Python is notorious offender here with args and kwargs - when reading code using some wrapper library I must understand how underlying library is used, because customization of underlying library behavior is not part of wrapper library documentation.
- b0rsuk 9y agoI agree. I'm learning Rust by rewriting someone else's small Python app in it. Rust requires you to define your variable types, especially for container types like vectors. I'm a decent Python programmer, and the app code is straightforward, but I realized I don't know what data the app operates on at each stage! I was forced to randomly insert print() around. Maybe it's time to finally learn gdb...
- SilverSlash 9y agoPython does support type hints, though most people don't use it. Also, I meant self documenting on an algorithmic level, not at a data types level.
- steveklabnik 9y agoWhat connection does this have to the post? Python is only mentioned once, in a link, and it doesn't mention speed at all.