6 ms·
Yeah, as much as I hate python (after 10 years of a career based solely in it), “There are only two kinds of languages: the ones people complain about and the o
by Redoubts 4y ago
Yeah, as much as I hate python (after 10 years of a career based solely in it), “There are only two kinds of languages: the ones people complain about and the ones nobody uses.”
Although if I made a list it probably wouldn't match this one. Reason 1 and 2 are basically the same, and yeah this sucks and I wish I could just build a static binary like Go. I'm surprised more languages don't make this very easy!
Reason 3, I can't care about the whitespace debate anymore. But
> Deep nesting is permitted, but lines can get so wide that they wrap lines in the text editor.
??? This article is 5 years old, and we have black now to solve this; but I'm pretty sure most production code bases have had hard line limits in the style guide.
Reason 4,
> Finding a list of what can be imported is non-intuitive. With C, you can just look in /usr/include/*.h. But with Python? It's best to use 'python -v' to list all of the places it looks, and then search every file in every directory and subdirectory from that list
I don't think C/C++ is actually that much better at this?
> In contrast, many Python modules include initialization functions that run during the import.
They can but they commonly don't. A lot of python is about "we're all adults here", and that works surprisingly well.
Reason 5
> In every other language, arrays are called 'arrays'. In Python, they are called 'lists'.
I mean there's a good reason for that, and I don't think C++ would call that data structure an `array` either.
> Python seems to go out of it's way to not use the common terms found
Honestly CS loves to give +3 names to basic things all over, this isn't new to python. I don't think the author's chosen ones are correct.
Reason 6, I think newer languages are doing similar things with strings that python did, so I'm gonna say the wider community things this was a decent thing to do. And I'm not sure triple quotes is as complicated as =/==/=== in JS.
Reason 7,
> This means that changing the source variable may end up changing the value.
If you mutate an object I'm not surprised the change is propagated. But there are immutable values, notably strings, that will not work this way. I can't say this author shows much experience with any language in depth.
Reason 8, I don't think I've ever heard of someone complain about namespacing like this, and then compliment C.
These reasons all feel the like "it's not like the first language I used" rather than real issues.
What about default mutable arguments? What about namespacing of loop variables (and other wild ass shadowing rules when you do nested functions)? What about tooling??? You haven’t lived until you’ve made pylint or MyPy crash. And when they work, they are slow! And MyPy can be unstable in results on large code bases!
- acdha 4y ago> > Finding a list of what can be imported is non-intuitive. With C, you can just look in /usr/include/*.h. But with Python? It's best to use 'python -v' to list all of the places it looks, and then search every file in every directory and subdirectory from that list > I don't think C/C++ is actually that much better at this? Yeah, I really don’t know how someone could work with C and not have experience with include or linker path issues. The section on installation shows he doesn’t understand how Linux packaging works, though, so I think it’s something along the lines of a mental model which doesn’t include the extensive time which the Debian / Fedora maintainers have spent packaging that code, or that the reason why they’re not having versioning issues is that they’re using systems which only change the version on system upgrades. He could have avoided those issues with Python by only using the distribution packages just as with the C libraries, or done the inverse by preparing packages for a newer version of some C library.