Hacker News new | ask | show | jobs
by finaliteration 2113 days ago
Can you elaborate a bit more on what bothers you about Go? “It’s not Python” could encompass a lot of things.

Personally, I use both languages (as well as Java and C#) and find they do really well for different tasks. If I need a binary command-line tool that I can ship off fairly easily I turn to Go. If I need to quickly parse some text files, bang out a quick HTTP client script, or automate some AWS tasks, I’ll go with Python.

1 comments

It's been a while since I last touched go. But I remember having a bunch of fun with it when coding up some mathematical challenge problems.

Off hand here's what I remember:

Any two integers can be calculated in python without issue. In C/C++ and golang, you have to check for overflow somehow.

So when python decodes a json, any large integer get parsed correctly and put into memory. With golang and C/C++, those are extra corner cases.

panic() seems to be half-hearted. Kind of like C++'s attempt to use exceptions. Not completely unhelpful, but not a big productivity win. But in either language, the stack has to unwind -- so it feels like they could have used exceptions, and golang errors can be a class with it's own type...

Index out of bounds in arrays panic, in python it's just an IndexError.

Channels block, and trying to work around that is weirdish. It's akin to unix file descriptors, but I can ask unix if the file descriptor would block before I use it. What's wrong with:

    ok, err = ch.send("message", timeout=5)
Non-blocking would just be:

    ok, err = ch.send("message", timeout=0)
I decided not to move to go, in the end. While yes, go would be faster, many of the things I'd use on a day to day basis wouldn't change. Databases, network speed, file/disk access, etc.