Live data from Hacker News

Why We Switched from Python to Go (2021)

softwareengineeringdaily.com

41–50 of 301 posts

Re: Why We Switched from Python to Go (2021)

#41

I read somewhere on HackerNews that Python is kinda like a default language and rest such as Go, C, C++, Java are just for Optimization, once you figure out your solution.

Python has problems scaling to medium-size code bases because programs above a certain size tend to become difficult to reason about. This is not a performance issue, and it’s the #1 issue that I choose to rewrite Python programs in other languages. Python type annotations help.

IMO modern languages like Go and Java are pretty easy to get into and you can use them for a first implementation without really sacrificing development time relative to Python, as long as you have invested the time to learn those languages and the associated tools. (C++ is not like that unless you have made a very serious investment in setting it all up.)

I’m not trying to say that any of these languages are better/worse, just that they are differently suited for particular situations (program size, team experience, etc)

Re: Why We Switched from Python to Go (2021)

#43
post #29

I read somewhere on HackerNews that Python is kinda like a default language and rest such as Go, C, C++, Java are just for Optimization, once you figure out your solution.

Python is an excellent choice for that. What I tend to do is build with Python and, if (and that's a big if) the thing needs to be orders of magnitude faster, then we profile the app to find the hot spots and optimize those, either in Python, with some better approach, or in another language still being called from Python. A rewrite of a whole service from scratch is relatively rare in my experience (unless the origi…

I take a similar approach. Python allows me to rapidly prototype and ... gets the job done — fast (in terms of developer productivity). Once performance becomes a main criteria, it's not so difficult to fork/exec some Go/Rust/C/C++ executable.

Re: Why We Switched from Python to Go (2021)

#44

I read somewhere on HackerNews that Python is kinda like a default language and rest such as Go, C, C++, Java are just for Optimization, once you figure out your solution.

On first startup we used Tcl, and C code for performance, similar to what is fashionable with Python nowadays.

I had enough of the rewrite in C experience that since then, if the language doesn't come with a compiler on the box, either JIT or AOT, I only see it as scripting language for sysadmin work or learning purposes.

Re: Why We Switched from Python to Go (2021)

#46
post #45

Go vs Python comparision is really useless because of very different approaches and tools. Looks like “Why we switched from screwdriver to hammer”.

My team struggled with screwdriver for years before finally biting the bullet and switching to hammer. The first few days were tough, but after we learned the biggest pitfalls (hello bruised thumb gang) our productivity skyrocketed!

Re: Why We Switched from Python to Go (2021)

#48
post #6

"Developer productivity and not getting too creative" is NOT a point in favor of Go. Go does not have a lot of batteries included. Things like error handling, logging, test bootstrapping, etc, require consensus on the team and tight coordination. Every project is basically its own framework. Most teams are not that well-oiled. They are going to find this out the hard way. And fast? Please. If your database queries ar…

Recent-ish experience:

- Wrote a distributed app in Python (it aggregated a few GB / day of info from several thousand servers). Performance was terrible, though I was doing all the right things (async I/O, etc.).

- Rewrote it in Go. That worked really well, and took just a few days. But management freaked out, forbade Go in engineering, and so:

- Spent several months rewriting the whole thing in C++. What a fucking misery. Just getting HTTPS working was a depressing experience. Package manager? No, you get to trawl the internet for semi-busted projects that sorta kinda maybe work, and then bend them to fit.

Go is the sweet spot between "Python isn't fast enough and never will be" and having to reinvent the wheel in C++.

Re: Why We Switched from Python to Go (2021)

#49
post #33

Earlier quoted context omitted.

I think the latter point about "less ceremony" is extremely debatable especially on a larger project.

How does Go have more ceremony than Rust without a borrow checker, lifetime annotations and all?

This is why languages like Go offer automatic dynamic memory management, or more simply, garbage collection.

https://medium.com/safetycultureengineering/an-overview-of-m...

Re: Why We Switched from Python to Go (2021)

#50
post #25

Earlier quoted context omitted.

The last time I was on a team using Go, we ended up ditching it for these reasons. We realized it took about as much specialization and wheel reinventing as Rust, which offered way better developer ergonomics in ways that mattered to us and wouldn’t panic over things that weren’t easy to predict or caught by the compiler. There were still tons of trade offs, but it worked well for us. Go is cool but I still can’t see…

I prefer Go when I want more safety/performance than Python but less ceremony than Rust.

Fair enough, there are certainly cases where Go is an awesome tool to use.
Post reply on HN