4 ms·
I maintain hundreds of thousands of lines of Go code, for a few years now. I would not pick another language for that. The important properties with maintainin
by cle 5y ago
I maintain hundreds of thousands of lines of Go code, for a few years now. I would not pick another language for that.
The important properties with maintaining code bases like that are language regularity (most code is written the same way and you don’t have to make personal “taste” decisions on things), good documentation and online communities, well-maintained libraries, tooling features for versioning and namespacing, deployment simplicity, etc. Go nails those things.
I agree that Python is great for interviews. I would not use it for a large codebase maintained by a bunch of people for years, unless there is a really compelling reason.
- mixmastamyk 5y agoTyping is available now, and other QA tools for years.
- kuang_eleven 5y agoPython has all of those things: - language regularity; black has been the default for years now, and if you want to enforce a different style, there are other tools - documentation and online communities; not even a contest, no language comes close to Python in extensive documentation and online support - libraries; much the same, Python standard libraries are world-class - versioning & namespacing; Depending what you need from this, Python is again more robust, namespacing in Go is a disaster. - deployment simplicity; ...alright, you got this one. Python deployment is harder than it should be. Still, I find my Docker images about the same complexity between the two; more complex deployment in Python, but no need for compilation
- cle 5y agoBy regularity I mean much more than just style. Ironically Go does “one obvious way to do something” much better than Python. When formatting a string, should I use % operator, str.format(), or f-strings? If I want to make a data obj, should I use a regular class, dict, namedtuple, dataclass, or TypedDict? If I’m changing each element in a list do I use a list-comprehension, or loop, or map()? Even unit testing in Go is mostly converged on the stdlib framework, in Python it’s constant back-and-forth between unittest, pytest, and nose. Static typing? Mypy, PyRight, Pyre, Pytype, with varying degrees of IDE support. Speaking of IDE support, which of the 3 major LSP servers should you use? How do I specify dependencies, with raw pip, Conda, pipenv, or poetry? When setting up my dev env should I use virtualenv or venv, or do I not have to use it bc of pipenv or Conda? (I only actually use one of each of those with my own code, but I have to know about them all to work in the ecosystem.) Also IMO, Python’s stdlib comes nowhere close to the quality of Go’s. Somehow despite all this I still enjoy writing Python, and use it sometimes for my personal stuff. But in a team setting on a large code base? Nah.
- ngrilly 5y agoGo namespacing works quite well in my experience. As well as Python. No idea what you mean.