Live data from Hacker News

Why We Switched from Python to Go (2021)

softwareengineeringdaily.com

281–290 of 301 posts

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

#281

Earlier quoted context omitted.

Selecting multiple lines of text in an IDE does not require a mouse. Just hold Shift and use the up/down arrows. The ability to select text in this way has existed in Windows for at least 20 years.

I've literally never coded in Windows. Seems like a weird choice.

I'm a gamer, so Windows is my daily driver. I'm not going to install a Linux VM just to run PyCharm and VSCode.

Professionally, I'm at the whim of whatever environment my employer uses. I've used Linux (CentOS), Windows, and Macs. If I'm doing Python development, then it's pretty OS agnostic unless I'm using a Python module that compiles to a native binary, in which case Windows is certainly a nightmare.

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

#282

Earlier quoted context omitted.

That's a great point, and one I hadn't considered. One language feature that Go brings is first-class multi-threading and communication amongst and with child threads. The only languages I know that can compete with Go with similar properties are Nim, Zig, and Rust. I'd like to include Delphi / Free-Pascal, but cross-compilation can be a bit of headache at times.

I didn't know Mom and Zig had those properties, I'll have to check them out. Rust I believe doesn't do true cross-compilation, isn't it just relying on you using virtualization like docker and other to do so?

Rust does "true" cross-compilation, yes.

There is a tool, "cross," that uses Docker as part of its workflow, but it's not inherent in Rust's abilities to cross compile.

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

#283

Earlier quoted context omitted.

I've literally never coded in Windows. Seems like a weird choice.

I'm a gamer, so Windows is my daily driver. I'm not going to install a Linux VM just to run PyCharm and VSCode. Professionally, I'm at the whim of whatever environment my employer uses. I've used Linux (CentOS), Windows, and Macs. If I'm doing Python development, then it's pretty OS agnostic unless I'm using a Python module that compiles to a native binary, in which case Windows is certainly a nightmare.

I'm just saying there are editors worth using beyond PyCharm and VSCode, some of which don't use the tab key to indent selected text. Kids these days don't respect the old ways grumble grumble....

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

#284
post #261

Earlier quoted context omitted.

> Its perfectly possible to write low latency high scaling code in python, just as it is in go and rust. Depends on what you mean. A tiny and simple HTTP handler brought up on lambda, sure, Python will be as good as anything else. Anything larger than that, and no, it isn't. Python just doesn't have the semantics to do what Go and Rust can at scale. I run a service that uses 4 threads in Python and it's horribly slow…

> I run a service that uses 4 threads in Python and it's horribly slow and unreliable. I worked on a service in Go that used hundreds of concurrent go routines and it was reliable as hell. That is very anecdotal to the point where I’m not sure it is all that useful. Go is supposedly good at parallelism, yet it has plenty of warts to the point where it is not at all more stable than any other mainstream language out t…

> it really is not better than what you can do in Java or C#

Theoretically, sure. If you _really_ know your stuff.

However, you can naively pack hundreds of thousands of go routines into a single thread in a go routine after a week or two of using it.

I'm not saying go is better, I'm just saying Java copied this abstraction for a reason: doing it right is hard

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

#285

As with all of these posts, the big reason is never really written: "I just wanted to learn a new language" Now, the points they've made are valid, Go concurrency beats the pants off python, and with gofmt, there is less of a debate about style. Te bit about finding a team is pure horse cock. As they point out there are a bunch of C++/C programmers about. There are even more python programmers too. Go is a tiny pond…

co-founder and CTO of Stream here. I did not write the article but I was very involved with the decision process. Your assumption is wrong, we did not pick a different language just for fun or because we wanted to learn something new :) Python was just not the language we needed for our APIs, we tried hard to make it work but eventually we looked at alternatives that would allow us to keep things simple and performan…

Are you using Go's http library or are you using some other framework?

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

#286
post #262

Earlier quoted context omitted.

It’s also an example of how Go thinks about all problems. Do things one way that is well made and roughly satisfies most use cases

(Other than Generics, which was known to be required decades before its existence.. sorry)

required is a strong, but personal opinion. go's generics are just type switches for the lazy (over simplified)

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

#287
post #271

Earlier quoted context omitted.

Where is the joy of learning a new language if not for learning new concepts? It just does not make sense to me. Learning a new standard library and build tools and all that stuff? Is that much fun? People want to learn a new language for reasons: perhaps they want to learn new concepts, perhaps they want a language that's faster, perhaps they want a more mature ecosystem, perhaps they want to increase their employab…

Maybe go is faster than any other language they've used? I'm not contending the fact that they have a reason for wanting to learn go as that new language. Just that your claiming they clearly weren't interested in learning since they didn't choose some esoteric language is fallacious.

> Maybe go is faster than any other language they've used?

Quite possibly! That would be consistent with my point that they chose Go for practical reasons, rather than to learn for the sake of learning, as KaiserPro was suggesting.

If you want to learn for the sake of learning, you'll learn a different paradigm, rather than rehash the same thing with a slightly different flavour. Also probably your productivity will tank.

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

#288
post #287

Earlier quoted context omitted.

Maybe go is faster than any other language they've used? I'm not contending the fact that they have a reason for wanting to learn go as that new language. Just that your claiming they clearly weren't interested in learning since they didn't choose some esoteric language is fallacious.

> Maybe go is faster than any other language they've used? Quite possibly! That would be consistent with my point that they chose Go for practical reasons, rather than to learn for the sake of learning, as KaiserPro was suggesting. If you want to learn for the sake of learning, you'll learn a different paradigm, rather than rehash the same thing with a slightly different flavour. Also probably your productivity will…

Can it not be both? Someone can want to learn for the sake of learning, and then filter further using practicalities. I'd love to learn every programming language out there, but it wouldn't be possible, we only have a limited amount of time in this life, so I'll instead learn the ones that are the most practical to learn. Java, however practical, may not be interesting to me so I may not learn it. Piet is super interesting, but not all that practical so I'll probably never learn it.

It doesn't have to be a single variable equation. I can learn something both to learn it and for practical reasons.

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

#289

I have experience with both (and a lot of other languages) and honestly - I wouldn't move from Python to Go. I'd move from Python to the very latest version of C#. You get far better tooling, excellent performance, the ability to write extremely concise code (as long as you don't apply mainstream coding standards/style) and a better range of libraries for most situations than Go. More chance for re-use too (i.e. same…

This. I write in several languages (mutli-lingual project: C#, Python, JS/Node, JS/Front etc) and C# provides the best experience by far.

Everything you said above plus BIG community. C# is the top #4 language on StackOverflow, it's even more popular than PHP and HTML.

By comparison, Go is not even among the top #50. I'm not saying Go is a bad language, just bare numbers. Every problem you're going to bump into with C# - has been arleady discussed and resolved already.

P.S. latest .NET-core beats C++ in some benchmarks I love that

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

#290

Earlier quoted context omitted.

> Web frameworks are inferior to those in most other languages. That's quite a statement. Go on, for most of the other languages, show me a web framework that's better than Django. Python absolutely has deployment challenges, but the performance is Good Enough™ and the speed of modelling and maintaining and accessing databases in Django's ORM is so much better than anything else I've found. Its Admin interface too is…

> That's quite a statement. Go on, for most of the other languages, show me a web framework that's better than Django. I think that’s subjective, so take this with a grain of salt. I do have a different opinion though. Also, my point isn’t to argue, but to encourage consideration. I’ve used Django and Python quite extensively in the past and I would say that, for me, Phoenix/Elixir and Ruby on Rails are both better w…

That's fine. I disagree, but that's fine too.

What I took issue with was the suggestion that "most other languages" have a better web framework. I'd wager most other languages don't even have a web framework. And even amongst those that do, there's some real dirt out there, and much worse examples of packaging, tooling, etc. Two Python frameworks, Django and FastAPI would be in my as-objective-as-possible top 10.

It was a silly thing to say.

Post reply on HN