Not to be shit-eating, but I never understood why people use python instead of Go other than for ML teams. I program mostly in Java and Go so would love a perspective.
Probably for the same reasons people use Java and Go instead of C. It's just more convenient sometimes. But sometimes not.
In terms of building a team at a company? In my experience it's been arbitrary. Manager / Lead has experience in language X, decides to hire people who also know it. Or all the other teams are already using language X. Or Manager / Lead has heard "X language is good at Y" and decides to go with that. Or there's simply 10x more engineers (and cheaper) available for language X than Y.
The times I've seen a language picked for a particular purpose:
- Perl/Python used for web apps. It's interpreted so you can just upload your source code and refresh your browser. Faster and simpler than having to compile/package it, lots of useful frameworks and modules, lots of developers.
- Erlang/OTP for telecom. Kind of on the nose, but there you are.
Yeah I get that, the same reason why I question some of the teams I've been on choice of JS frameworks, it's just what the developers were familiar with.
Go compiles so fast and reads cleaner imo, that I never saw the benefit of python. I always thought debugging python was clunky, could be unfamiliarity with interpreted languages. Also a few times I needed to use an ODBC driver with python left a bad taste in my mouth. But overall I get what you're saying, my new team writes all of their lambdas in python so I'm going to have to learn.
I use mostly Python, with a little Golang in my job and my reasoning is:
1. Most of what I am doing is calling other programs, often over ssh. The speed difference between the two is going to be tiny (where it is not, I use Golang)
2. Python is a more ergonomic language to work in a lot of the time. Wrapping a series of steps in a try block and then handling the errors in one go (very common in the things I am doing) is just easier to write, easier to maintain, and easier to read than what I have to do in Golang. And there are a ton of modules in Python that are just easier to work with than in Golang. And the resistance to the 'while... else' and 'for... else' patterns just saddens me. And the 'for' implementation in Golang often makes me want to tear my hair out... why make it hard to do this by reference?
3. Even in places where Golang should be much better, sometimes it is a challenge. For example when I am trying to parallelize something, but want to only have N number of workers going at a time. In Python I just use the worker pattern and I am done, I can even feed from one set of workers to another. In Golang I have to use a limited channel, and be careful that I block on that channel before I do anything that is going to eat a lot of memory (otherwise I have protected the CPU, but not memory resources). It feels like I am fighting the language there.
For what it's worth, go is still "new" in my book. I'm seeing 2012 for the first 1.0 public release. In contrast, we've had python since 1991. There's a large number of programmers who haven't had a chance to be exposed to go. I have used it, and enjoyed it. I'd expect, but haven't confirmed, that python has a larger collection of libs (especially long tail).
Although, looking now I'm seeing a short support window for go releaI. That can hurt uptake.
Like go 1.18 was released 2022-03-15 and will EOL Q1 2023.
Lots of projects want long term support so that churn isn't desired. I'm curious how teams handle that.
> Not to be shit-eating, but I never understood why people use python instead of Go
I've got a few sysadmin type scripts I wrote in perl that I'm currently rewriting in python because other people will use and need to update those things and they will be more likely to know python than perl. I can't imagine they'll be more likely to know Go either.
In terms of building a team at a company? In my experience it's been arbitrary. Manager / Lead has experience in language X, decides to hire people who also know it. Or all the other teams are already using language X. Or Manager / Lead has heard "X language is good at Y" and decides to go with that. Or there's simply 10x more engineers (and cheaper) available for language X than Y.
The times I've seen a language picked for a particular purpose:
- Perl/Python used for web apps. It's interpreted so you can just upload your source code and refresh your browser. Faster and simpler than having to compile/package it, lots of useful frameworks and modules, lots of developers.
- Erlang/OTP for telecom. Kind of on the nose, but there you are.
- C and C++ for embedded applications.