Golang Part 1
Recently I started learning Go, Google’s internally-developed language. It’s also known as “Golang,” because it turns out that “Go” is a terrible search term.
You might ask yourself, as I did, why Google needed to develop a new language. I had heard of Go for a long time, but I’d always dismissed it as a vanity project. Google inventing their own language sounded like a supreme act of arrogance, a trick to trap developers into specializing in job skills that can’t be used anywhere outside Google. The old “domain specific language” trap.
But as we roll through 2021, Go is gaining momentum outside of Google. It consistently shows up on lists of programming languages to know (here, here, and here).
But what did Google need a new language for? From what I’ve been able to gather, Google predominantly used C++ and Java internally, and Golang was developed to address the shortcomings of those two languages. C++ is fast, but hard to use. Java is easy to use, but slow. Neither has easy concurrent coding features. For market reasons, Google obviously wouldn’t want to use anything from Microsoft, or any other proprietary solutions.
On the evolutionary scale of programming languages, Go sits exactly between C and Java, meaning somewhere between the Wild West of a low-level procedural language, and the Authoritarian Dystopia of a strictly typed, object-oriented language. It has some features of both.
Among Go’s attractions are:
- It’s free and open-source. Just download and start writing on any platform.
- Syntactically, it’s fairly easy to pick up. It’s basically C without the parentheses and semi-colons.
- It has robust concurrency models built-in, a boon in the modern world of distributed computing that Google needs.
- It’s garbage-collected and “safe,” like a modern language.
- It compiles to native code, so it runs really fast.
- It has a lot of community support.
There are some drawbacks:
- There’s a bit of open-source jank, the kind of inconsistencies that always appear when there are thousands of different cooks working in the kitchen, instead of a single vision carefully thought-out from the top. Sometimes there’s no rhyme or reason for a syntactical element, you just have to memorize it.
- There’s not much in the way of GUI support. It’s for making command-line tools.
- IDE support is fairly primitive right now. Welcome back to the 90s. Visual Studio Code works well, though.
- It might have too much community support. There’s some religious zealotry.
My only point is that it’s worth looking into, contrary to my first impressions from years ago. Maybe it will work in a project for you and maybe it won’t. But it certainly wouldn’t hurt to be able to put down some familiarity with Go on your resume. Especially since it’s the second highest-paid language on that StackOverflow list.
Here are some resources I looked at to pick up the basics fairly quickly:
- Golang.org has a decent set of introductory tutorials: A Tour of Go.
- freeCodeCamp has a pretty good video introduction to the language: Golang in 7 Hours.
- I solved problems on Leetcode.com in Go for hands-on practice with both Go syntax and algorithms.
Note: Comments are disabled on older posts.