Should I Go? The Pros and Cons of Using Go Programming Language

It should come as no surprise to most that Google launched their own programming language. The company has been moving aggressively into practically every technological sector imaginable — and more often than not, they end up revolutionizing the sector they’re looking to develop. It’s now been over a decade since Go entered production, and while it might not have the install base of languages like Python and JavaScript yet, Google’s proprietary language has a lot to offer. Here’s everything you need to consider before you decide to pick up this language.

Pro: ease of use

While Go might not be as popular as JavaScript or Python, it does have one important thing in common with them: it’s eminently easy to understand. The syntax is clean and accessible to newcomers, and there aren’t a lot of complex functions to learn. But that slick and clean syntax offers advantages to more than just newbies. That’s because it’s an easy language to read as well, and that makes it a great choice for legacy code that may involve multiple coders iterating over each other’s code blocks. The close similarities to C-style languages mean that it will be a simple language to learn for programmers proficient in C++ or C#.

Con: sometimes too simplistic

One of Go’s main advantages is also one of its biggest weaknesses. Go may be an easy language to pick up, but that brings with it a lack of versatility. Some of the hottest languages on the market pride themselves on their complexity. Choices like Swift and Haskell may be more difficult to learn, but they manage to find their fans by packing in a wealth of smart abstractions that allow coders to achieve complex and clever results with less. By stripping out this high-level functionality, Go also sacrifices range.

Pro: A smart standard library

Go users can accomplish a lot without having to import or learn complicated secondary libraries. The standard library that comes packaged with Go is sophisticated without overwhelming, and it reduces the risk of errors from conflicting function names. Take the example of slices. It’s one of Go’s smartest additions to the programming world, and they offer a simpler way for incorporating data structures into your code blocks. A number of tasks that would require complicated workarounds in other languages can be accomplished with a single line of code through the Go interface.

Con: It’s still a young language

There’s a lot of promise in Go, but it’s a language still in its adolescence, and that means that in many ways it can’t compete with its older siblings. Go’s native library may be smartly designed and efficient, but it’s competing with languages like Java that comes supported by a huge collection of code built in and a cottage industry of new libraries created by an enthusiastic and engaged community. While Go may eventually catch up with its peers, it still has a long way to go in terms of library support.

Pro: Strong security built-in

Simpler code is generally safer than complicated code, and that’s absolutely the case with Go. As a statically typed language, you don’t have to worry about complex and hard to identify errors that come from the huge number of variable types present in more dynamic languages. Then there’s the included garbage collector which helps prevent memory from bleeding off in your code. While the lack of generics means that coders need to be more diligent in running tests, identifying errors is easier than it is in many alternatives, and that generally promotes a more thorough approach to writing clean code.

Con: Lack of a virtual machine

While the decision to not base Go on a virtual machine was a conscious choice, and it’s one that comes with some distinct advantages designed for ease of use, the bad may very well outweigh the good here. There’s a reason that so many of the popular languages today are based off of VMs. VMs offer more efficient code, and that means that Go file sizes often dwarf those of competing programming languages. While Google has slowly been improving the efficiency of the language in the past few years, you can still expect more complex programs written with Go to quickly chew through your RAM.

Pro: Google’s prominence in the industry

It’s unlikely that Google is going anywhere anytime soon. They’re unlikely to find a challenger in the general search engine space in the near future, and they’ve somehow managed to nudge aside Microsoft as the preeminent and unchallenged ruler of programs used in the office. And while Google often falls out of love with their big and ambitious products (see Google Glass or the extensive graveyard of social media platforms), it doesn’t look like they’ll be abandoning Go anytime soon. You can be pretty sure that Go will play a large part in Google’s architecture for a good long time.

Con: It hasn’t quite found its niche

Go was designed by Google to accomplish some of the specific tasks that Google programmers needed to accomplish more efficiently. That makes Go programming a phenomenal skill to have if you work at Google, but it still hasn’t managed to find a name for itself in the larger world. Where JavaScript has become the language du jour for complex front end programming and Python has found a place in the world of data visualization and analysis, Go has yet to make a good argument for where it exists in the wider programming ecosystem. Add in the fact that other companies will be hesitant to invest in a language essentially owned by a competitor, and it becomes clear that Go might remain largely a Google language used by Google engineers.

Pro: Smart documentation

While Go is an eminently simple language to both write and read, that doesn’t remove the need to document programs. Standard policies are in place for documenting all the included functions and libraries, and Google’s language even alerts you when you forget to put documentation in place. That’s an especially valuable asset for younger programmers, who have a tendency to fall into sloppy documentation habits early on.

Con: No GUI library

Go is a great choice for single-page apps. Though, Go has no GUI library which means a lot of time and knowledge you’ll need to connect a library to your app instead of using native solutions like with Python or Java.

There’s no such thing as an all-around perfect programming language. The best language can do is hope to do one or two things better than all the other languages around. For Go, the most obvious strengths are clear. Its ease of use, combined with its high adoption at Google makes it a promising young language. But it’s not going to be the right fit for every project or every programmer. Consider the strengths and weaknesses carefully before adopting it as a new language to learn or trying to fold it into your organization’s infrastructure.

read original article here