4 ms·
Question from a very amateur coder: why would I look at Python for performance when Go exists? I recently learned enough Go to rewrite some small tools for wor
by trabant00 5y ago
Question from a very amateur coder: why would I look at Python for performance when Go exists?
I recently learned enough Go to rewrite some small tools for work that weren't fast enough for our current load and got 5x to 10x the performance. Took me 1 week staying 2h after work to learn Go from scratch for this. Goroutines and channels seem easier to manage than asyncio. Same numbers of lines. My coworkers who don't know Go understood the code just fine.
The only thing I'm not sure so far is the github packages. One one hand I can deploy anywhere and don't care about dependencies, on the other with python I got automatic and vetted updates straight from the linux distribution.
- turbinerneiter 5y agoYou are not looking at Python for performance. This is the problem that above initiative wants to fix.
- SiVal 5y agowhy would I look at Python for performance when Go exists? If you're aware of the issues and have other options, you wouldn't look to Python for performance unless it was a case where Python is just used to script pre-existing C libraries (ex: machine learning). For general performance, you would choose Go over Python. If you choose Python, it will be for some other reason such as ease of programming, extensive and well-developed libraries, ease of hiring Python programmers, etc., where Python is better than Go and fast enough. I've always loved Python and have done a LOT of it (professionally and privately) over many years, but Go has replaced most of it. Having fast, concurrent apps statically compiled into a single executable is a huge improvement for many of my uses of Python, esp. server-side apps and local command line utilities. But I would still prefer Python as a teaching language, for machine learning, for quick one-off tasks (ex: format an ugly chunk of copied data into C++ source code), and possibly for code that I wanted others to write and maintain for me. (Python programmers are easier to hire than Go programmers.)
- cdumler 5y ago> Question from a very amateur coder: why would I look at Python for performance when Go exists? Many things can be "fixed" if you choose to go to another system. Good developer environments limit the supported tools, languages and packages. This comes from several issues: * When something goes wrong at 2 a.m., is the developer available going to be able make a reasoned decision how to fix the program? * Can you hire people with a mix of Python and Go experience? * If you want performance, why not choose a faster variant of Python so you stay in the same skill set? * You successfully built a Go program, but did you document your development? Did you set up a standard environment? What about CI/CD and automated testing? When you leave your position (and you will someday), who is really able to take over managing that software? > My coworkers who don't know Go understood the code just fine. Understanding and groking are two different things. I'm sure they looked at the code, nodded their heads that it makes sense; however, I suspect that if you asked one to modify the program with a new feature that they suddenly will see all the things that they don't know, from getting their environments working to subties in the language's mechanics. Environments are standardized to prevent having these types of issues between workers. Software development is ultimately about supporting the people and business goals in the company.