4 ms·
FWIW, I have 15 years of experience with Python and only 10 with Go. In my opinion, Go is simpler in general, but the most important "domains" in which it is si
by throwaway894345 5y ago
FWIW, I have 15 years of experience with Python and only 10 with Go. In my opinion, Go is simpler in general, but the most important "domains" in which it is simpler are as follows:
1. Tooling. Things like package management, single-binary deployment, profiling, etc are far simpler in Go than Python.
2. Performance. Optimizing Python is a painful endeavor. And the usual platitudes (e.g., "just rewrite the slow parts in C!") have significant caveats. Naive Go tends to be hundreds of times faster than optimized Python, and when you must optimize Go, it's typically just moving allocations outside of a hot loop or something trivial by comparison.
3. Concurrency. Python's async framework leaves a lot to be desired. If anyone calls a library that makes a sync call under the hood or uses too much compute, the whole process gets hosed and it's really difficult to identify the culprit. I also regularly see people forget to await the result of an async function--yeah, these are type errors and yes if you have the forethought and unlimited time you can write tests for any kind of type error, but this isn't a good use of anyone's time.
4. Rails. Go guides people toward good code. It guides people away from the kind of code that dynamic typing purists tend to write. For example, in the Python standard library, the type of an object returned by the `open()` API varies based on the value of an input parameter. Similarly, matplotlib, pandas, sqlalchemy, etc do silly things like this (although specific APIs aren't coming to mind). And of course there's a whole universe of junior engineers who try to emulate these things. As an aside, these rails are largely a matter of static typing, which also means automatic documentation (compared with Python's "x is a file-like object" with no information about what "file-like" actually means--does it support read? write? close? seek? truncate?) and great static analysis tooling.
- Karrot_Kream 5y agoFWIW I agree with you on most of this except for scientific computing libraries like matplotlib and pandas. A lot of these are used for exploration so the weird dynamic typing going on is specifically for the ergonomics of exploration. Everything else I agree with. I also think that Python is a particularly deplorable example of this though because of its longevity and its use by people who aren't career programmers.
- throwaway894345 5y agoI could buy this for those limited use cases (although since more and more we're productionizing scipy code, it would be nice to have sane, maintainable APIs as well as rapid-iterating APIs, but I digress...), but the fact that these are so common across the ecosystem is the more troubling bit (and I think we agree here). :)
- nickd2001 5y agoThanks for the helpful perspective :)