Ultimate Python Study Guide
github.com
github.com
Erlang, UNIX, C, by all means.
Windows, C++, Java, no thanks.
Python is rare in that it's in the middle: it's very useful, and I don't hate it, but neither am I a big fan.
I find Python, C, C++ and Java to really be the same, in terms of computational paradigms.
I find the ideologies behind the language awkward, particularly explicit error object returns, but ultimately I feel upset with what boils down to ‘it’s not python’
Am I destined to hate Go? Some python limitations get to me, namely multiprocessor support and dynamically types fuzziness (typehint sugar is nice but I’d like my compiler to explicitly fail thanks).
Try it, you might like it.
Personally, I use both languages (as well as Java and C#) and find they do really well for different tasks. If I need a binary command-line tool that I can ship off fairly easily I turn to Go. If I need to quickly parse some text files, bang out a quick HTTP client script, or automate some AWS tasks, I’ll go with Python.
Off hand here's what I remember:
Any two integers can be calculated in python without issue. In C/C++ and golang, you have to check for overflow somehow.
So when python decodes a json, any large integer get parsed correctly and put into memory. With golang and C/C++, those are extra corner cases.
panic() seems to be half-hearted. Kind of like C++'s attempt to use exceptions. Not completely unhelpful, but not a big productivity win. But in either language, the stack has to unwind -- so it feels like they could have used exceptions, and golang errors can be a class with it's own type...
Index out of bounds in arrays panic, in python it's just an IndexError.
Channels block, and trying to work around that is weirdish. It's akin to unix file descriptors, but I can ask unix if the file descriptor would block before I use it. What's wrong with:
ok, err = ch.send("message", timeout=5)
Non-blocking would just be: ok, err = ch.send("message", timeout=0)
I decided not to move to go, in the end. While yes, go would be faster, many of the things I'd use on a day to day basis wouldn't change. Databases, network speed, file/disk access, etc.(Ok, that's more than a bit of an exaggeration, but relative to Go there's a lot of truth to it.)
Fun fact: JS is a pass by value language... except when it comes to arrays and objects, it then becomes pass by ref. Go figure.
I think that this is a feature, not a bug. Part of my maturation from a junior to a senior engineer was learning to trust that simple implementations are ok. I remember often not trusting that the simple thing would work robustly (passing around a list) and reaching for something way more heavy (perhaps a wrapper around sqlite persistence). I now recognize that the simple implementation is better and almost always more robust than something fancy, and I definitely attribute that to internalizing the zen of python over time.
> JS is a pass by value language... except when it comes to arrays and objects, it then becomes pass by ref. Go figure.
It's all pass by value. For objects and arrays, the value passed is the reference.
It's great for prototyping and for anything which doesn't require bleeding edge performance.