Hacker News new | ask | show | jobs
by s17n 1913 days ago
At Google, Go is mostly used for stuff that they would have used Python for in the past. Idk about the rest of the world.
1 comments

Currently working as a backend dev in a mid-sized company. Current directive is a gradual migration to Go for backend services that used to be written in Python/Django.
Why?
Go is a more restrictive language, which makes it slightly harder to create horrible codebases. It's also faster and a bit cheaper to deploy.
> which makes it slightly harder to create horrible codebases

Going to have to strongly disagree. It forces you to make horrible codebases with endless boilerplate code and increased complexity introduced by workarounds for abstractions you can suddenly no longer make due to questionable language limitations. You will get improved performance, however.

I've seen people complain about that, but I've been using golang for over two years, and I haven't really had to face that pain, yet. I used python for twenty years prior to that, and love sophisticated programming constructions (did a lot of work with clojure, learnt haskell, went through On Lisp), so it's not as if I don't know what I'm missing.
Any abstraction possible in Python can be expressed in Go just via the interface{} type, as the type of everything in Python is just interface{}.
No, that's not true at all. Just try to create an OrderedMap that supports the same abstract interface as Go's built-in map type, or try to implement a decimal floating point type that supports the same operators as the built-in binary floating point type. It's not possible.
Whether something can technically be done and whether it is good/easy/simple/etc. are totally different conversations. I'm pretty sure you can't implement a min function that works on both strings and ints in Go by using the interface{} abstraction.