You get almost zero runtime errors. If your program is wrong, it won’t compile. If you use Python, how many of your production-crashing errors are AttributeError
or TypeError
? Just can’t happen in Go. The most likely runtime panic you’ll encounter is an index error
because you were lazy and didn’t check the length before trying to access something.
Deployment is as easy as rsync
or scp
. Nothing to pip install
. All the dependencies are baked in. No need to have gcc
on the prod machine because you want to pip install
something that has to compile. No need to install PostgreSQL
on prod so that pip install psycopg2
will work, since it needs access to pg_config
.
Writing code for non-techie friends and family is as simple as giving them a single binary. They don’t have to have Python installed on their system (and forget about it if your program uses something outside the standard library).
The concurrency is amazing. You can actually do multiple things simultaneously, or have multiple copies of a function running. Parsing data? Web scraping? Consuming APIs or RSS feeds? Do it all at once! If you use Django and Celery, imagine having a single binary that does all they do and more – and can even listen on multiple ports simultaneously (for websockets, perhaps) all at the same time.
Smaller, simpler language.
Compiling to a static binary! Yes, I know this is kind of a repeat of deployment and sharing with friends, but I really can’t oversell this. My PATH
is bursting with command-line utilities I’ve written and which make my daily life simpler. Sure, many of them could have been written in bash or Python, but these are on a shared drive and guaranteed to work on all my computers without any dependencies. Plus the speed and concurrency benefits…
Speed! In my own side-by-side testing, most things run 4x - 10x faster. That’s from a couple of years ago when I was new to Go and wrote my Go code to mirror my Python code for a “fair” comparison (and no concurrency).
Jobs! There are relatively few Go developers in the world compared to Java, Ruby, and Python. If you learn Go you will be in more demand. I get contacted regularly because of the Go on my LinkedIn profile and in my GitHub repos.
Community! The go-nuts Google Group has the smartest, most mature group of people I’ve encountered in a tech mailing list in my life. They’re helpful and many have deep, old knowledge that they are willing to share with anyone who asks (nicely).
Feel free to ask me any questions about Go and I’ll answer if I can. If you want to post bits of Python and discuss how they’d look in Go, that could be fun, too. Maybe some of those could spin off into their own topics on this forum.
Happy Wednesday!
ShawnMilo