Live data from Hacker News

Why we switched from Python to Go

getstream.io

161–170 of 406 posts

Re: Why we switched from Python to Go

#161
post #56

I think there's a great value in code being straight forward and simple and that is very much not appreciated among many programmers. A good language enables you to "compress" your code without making the code flow impossible to follow. A bad language encourages you to obfuscate the flow of the program using wacky abstraction techniques. Go doesn't exactly hit the sweet spot for semantic compression due to lack of co…

I tried using Go this weekend and basically just abandoned it when I learned that it only had 'generic's for three built-in types and other than that you are forced to essentially dynamic cast everywhere. I just don't get the appeal. Go seems a lot like what you'd get if you just removed every language feature that anyone has ever complained about; for good reason or not.

It seems like the domains where Go is used often don't make heavy use of custom containers or data structures, so that makes the pressure on the language makers lower than it would otherwise be.

Re: Why we switched from Python to Go

#162
post #65
post #48

Earlier quoted context omitted.

> this is solved with virtualenv Except when you run into edge cases, which happens all the time.

elaborate?

When you build a piece of software on many layers of abstractions, something will eventually break and leak all the way up in a nasty way that is difficult to debug or fix.

I don't have specific examples in mind but I've had a lot of frustrations with virtual-env.

Re: Why we switched from Python to Go

#163
post #145

Earlier quoted context omitted.

> On the other hand, I've seen plenty of assertion based tests in other languages that report inane things like "1 != 2" or "true != false" when they fail. In Python, one would need to supply the message argument to avoid that. But Go seems no different, really; you still have to supply the message. My understanding of the testing package is that Python's: self.assertEqual(expect, actual, f'expected ({expect!r} != ac…

py.test does the magic walking, and it does indeed make for much less verbose tests -- no need to remember which self.assertSomething method to call either: x = 1 y = 2 items = [4,5,6] assert (x+y) in items Outputs this, replacing the variable names with values test.py:4: in assert (x+y) in items E assert (1 + 2) in [4, 5, 6]

If you aren't using pytest, you don't know what your missing. It cleans up so much of the testing boilerplate for python.

Re: Why we switched from Python to Go

#164
post #124

Earlier quoted context omitted.

And reddit. And a little thing called youtube (though to be fair last I read they're offloading a lot of the hot paths to golang and c via native modules).

Curious, where do you see that youtube is running Django? Python, maybe, but I don't think they run Django?

It's definitely python, but definitely not Django. I recall someone explaining to me that it actually predates WSGI standardisation so its not even WSGI its just all custom python from start to finish.

Re: Why we switched from Python to Go

#165

Why does anyone write web apps in Python? PHP? Ruby? Modern Java and Go are so much faster than the alternatives that it's stupid to consider anything else if performance is important. Golang and Java can manage over a half million HTTP responses a second. Node is pretty fast but why bother when Java is many times more mature in features, tooling, and and supports concurrency... And uses less ram and is usually faste…

I was wondering the same thing, and it frustrates me.

I think people obviously enjoy using Python/Ruby or whatever for small scripts, and by inductive reasoning they think they can enjoy programming even larger projects in these languages.

They also rationalize the slowness by pretending that performance doesn't matter or that the bottle neck is the database.

They abuse the adage about "premature optimization" being a bad thing. Not realizing that while it's stupid to prematurely optimize everything, it's equally unwise to write everything in a slow language. Using a fast language is not premature optimization; it's just the basic thing you need to do in order to not have a crappy optimization, which is a good thing , and everyone should do that.

Re: Why we switched from Python to Go

#166
post #152
post #140

Earlier quoted context omitted.

That applies to all languages with exception of C, because they didn't want to standardize it as part of the language, hence we got ANSI C + POSIX instead.

Don't forget Javascript which is ridiculously under-featured natively. At least C has the excuse of having to run on the bare metal of a wide range of architectures.

[deleted]

Re: Why we switched from Python to Go

#167
I've done a fair bit of web dev work in Python but I am currently building my startup (https://www.growthmetrics.io) in Go.

It is in the initial stages, but so far it has been pretty good - both as a learning experience and from a developer productivity perspective.

I've also open sourced a web app boilerplate that I extracted from GrowthMetrics' codebase - https://github.com/olliecoleman/alloy. It might be useful for people looking to get started with Go.

Re: Why we switched from Python to Go

#168
I cant help to feel that in Go performance is more important that developer productity. Go is the new C. The code looks a bit clunky, with lots of error checks.

I rather work in a language like Python or Kotlin where the code just looks like how you would think the code would like (if i would write it in pseudocode on paper)

However Go in big teams will really be nice. Thats why they invented it in the first place.

Re: Why we switched from Python to Go

#169

Why does anyone write web apps in Python? PHP? Ruby? Modern Java and Go are so much faster than the alternatives that it's stupid to consider anything else if performance is important. Golang and Java can manage over a half million HTTP responses a second. Node is pretty fast but why bother when Java is many times more mature in features, tooling, and and supports concurrency... And uses less ram and is usually faste…

I like how for the past 10 years, everybody has been espousing language/framework xyz as being superior for the reasons you've just said (asynchronous, responses per second, memory footprint etc), but as soon as you say Java does it all better, suddenly developer efficiency is most important.

FWIW, it always seems like a mostly zero sum game to me. Whatever efficiency you gain in using (e.g.) Python+Latest Frontend Framework+Backend Framework, you lose through having to wade through yet another set of new concepts and documents for those frameworks.

Re: Why we switched from Python to Go

#170

Python was my entry into the programming world, and I've been an evangelist ever since... Or I was until I ran into distribution and parallelism. Since then, Nim has been my go-to language of choice. It is all that Python was, plus unbelievable speed, compiling to shippable binaries, and some other cool language features that admittedly, are still beyond my scope of abilities. Still quite lacking in libraries compare…

Thanks for your comment here. I heard of Him from you here. It genuinely looks like the best of many worlds. Easy to use and learn like Python: Check Fast and efficient approaching the levels of C: Check Ability to spit out a binary that just works without installing all the batteries: Check (particularly hurt by this in Python) Uses multiple cores by default : Check I'm going to spend a good deal of time playing with this and building some CLI tools at work.
Post reply on HN