Do You Need to Learn Google’s Programming Language?
Jenna EricksonDecember 23rd, 20165 minute read
Jenna is the Marketing Manager at Codal, blogger, and technology + startup enthusiast. With a responsibility of Codal's marketing programs and brand management, she is always strategizing new ways to reach clients through content and inbound marketing tactics. In her free time, Jenna enjoys traveling, cooking and reading.
The relatively young Go programming language (commonly referred to as Go Lang or Google Go) was created by a team of three Google employees in 2009. Although the open source language was released in various beta versions, the first stable release came near the end of 2016.
Go Lang was designed to be scalable to larger, static-type systems such as C++ and Java. However, in terms of readability, Go Lang aims to be "light on the page", meaning that it avoids keyword / data type repetition that is often seen in Java.
What is Go Lang Used For?
If you're interested in working with stand-alone command line level apps or scripts, Go Lang works great.
But if you're interested in desktop applications and system level programming, Go Lang is slightly capped.
Most desktop apps that involve a graphical user interface (GUI) take place on the desktop level of programming. Although there are 3rd party projects for a Go Lang GUI on Github, there currently is not a user interface package that comes with Go Lang.
System-level programmers will be similarly disappointed. Although it is true that Go Lang programs can communicate with native system functions, there are better options out there.
If you're planning on working with systems design, kernels, or device drivers, you might be better off with the Rust Programming Language created by Mozilla.
For an intro to Go Lang, consider the Go Lang version of the classic "Hello World" program compared to the C programming language version of "Hello World".
According to the Go Lang Documentation , fmt (format abbreviated ) serves a purpose similar to the printf and scanf in C Lang. From the fmt package, Go Lang imports input and output (IO) functions compatible with the standard boolean, integer, float, and character / string data types.
More Language Specifics
Go Lang is referred to as a dynamic language. Unlike static languages, Go Lang allows the developer to extend objects and assignments while the program is executing. This points to the use of Go Lang in developing command line applications.
If you start reading the documentation for Go Lang, you'll notice that flow control is achieved in Go Lang using a smaller collection of very familiar "verb" keywords.
In most programming languages, for-loops and while-loops are nearly interchangeable. For this reason, Go Lang developers decided to remove while as a flow control keyword.
The below examples are both written in Go Lang. A typical for-loop is on the left, and the example on the right is (effectively) a while-loop written in Go Lang.
The function on the left prints the factorial sum of the single digit numbers. On the right, we have a similar factorial function which will print the final sum that doesn't break the level-cap of 1000.
Most other languages would have replaced the for loop on the right with a while loop something like while sum <= 1000.
Projects Written in Go Lang
Despite the relative youth of Go Lang when compared to programming language royalty, there are still plenty of applications written in Go Lang that showcase the strong command line usability of Go Lang programs.
If you use Sublime Text to write code, you might be familiar with the Go Lang-version known simply as Lime Text.
Lime Text is more than just a port, however. Google Drive integration is much improved. If you're interested in learning Go Lang, reading the open-source code behind Lime is a great way feel your way around the language.
If you're looking for a full stack development framework for Go Lang, Gorilla is the strongest option. According to Matt Campbell of The New Stack, there isn't a Go Lang framework with a larger community than Gorilla.
Conclusion: Learn C First
Are you an application / web developer, or a team lead at an mobile app development agency, wondering if you should have your team learn C or Go next?
Codal (UX design and web development company based in Chicago) recommends to learn C before diving into Go Lang. Here's why.
Go Language is best used as a more efficient alternative to C Language, especially for developers looking to make command line applications.
C Language first appeared in the 1970s, and the extension, C++, has been used to help create operating systems like OS X and the early Windows releases.
Go Lang's ability to communicate with the low-level device drivers means that there is potential for similar operating system development with Go Lang. However, don't expect Go Lang to replace any of the C Language variants any time soon.
If you have not yet learned any of the C programming languages, learning Go Lang will be much more difficult for you.