Recs.
Updated
Developed by Google and open-source.
GO is compiled to native C code and is much faster than Python for example.
SpecsUpdate
Pros
Pro High level programming language
It makes it easy to learn and the learning curve is friendly for beginners.
One can learn the main concepts and ignore unimportant details.
While in low level programming languages, like C, one should spend a lot of time on low level details even when developing very basic (web) service.
Pro Supports packages properly
Explicit package-level export/import. Package dependency graph (DAG) defines the order of compilation and initialization. Packages help to build the architecture and to deal with the complexity of the system.
Packages and clear dependancies makes it easy to understand the system (design).
No surprises -- easy to learn and to develop.
Pro Supports 'modules' in the form of packages.
Every Go source file contains a package line that indicates which package a file belongs to. If the name of the package is 'main', it indicates that this is a program that will be compiled into a binary. Otherwise, it will recognize that it is a package.
Pro Supports 'modules' in the form of packages
Every Go source file contains a package line that indicates which package a file belongs to. If the name of the package is 'main', it indicates that this is a program that will be compiled into a binary. Otherwise, it will recognize that it is a package.
Pro API documentation is rich in content; easy to memorize
Only features deemed critical are added to the language to prevent cruft from working it's way into the language. The language is small enough to fit inside one's head without having to repeatedly open documentation. Documentation is hosted on an official webpage in a manner that is simple to read and understand.
Pro The go compiler compiles binaries instantly — as fast as a scripting language interpreter
Compiled binaries are fast — about as fast in C in most cases. Compiles on every OS without effort — truly cross-platform compiler. As a result of the fast compilation speed, you can use the gorun program to use go source code as if it was a scripting language.
Pro Syntax for exported code from a package is simplified to be less verbose than other languages
Any variable, type and function whose name begins with a capital letter will be exported by a project, while all other code remains private. There is no longer a need to signify that a piece of code is 'private' or 'public' manually.
Cons
Con No user defined generics
This means that you can utilize strong typing only as long as you do not need a generic container like for example list. Only ways to deal with it is either code duplication or using interface{}
which means that you lose strong typing.
Con Doesn't have true enums
Golang does weirdness with const versus having real enums, like other languages. This reflects the stubbornness and shortsightedness of the core developers, similar to the issue with generics, where it was denied that it was needed until it became too obvious that it should have been added years ago.
Con Expects prior familiarity with tooling, "advanced" OS use
A standard step of even installing Go is modifying your path -- a person who's encountering their first language might not even understand. It's hard to escape using Go without familiarity with using build tools, managing and organizing project directories, etc. It's not as simple as Python's "just run the .py file with the interpreter."
Con Default package manager doesn't allow multiple versions of the same package to be used at once
Default package manager fetch all packages to $GOPATH
and use them across all projects which mean that 2 projects cannot use different versions of the same package. However 3rd party solutions exists. This has been solved with the dep tool and semver.
Con It appears Google uses position to snuff out or suppress other languages
Newer languages that could threaten Golang (or other Google controlled languages) appear to have suppressed search results on Google and YouTube. Dangerous situation where large company can manipulate user choice and market share. The freedom to freely choose and user rights need to be protected.
Con Hard to abstract even the simplest notions
Go is famously regarded as very simple. However, this simplicity becomes problematic in time. Programmers who use Go find themselves over and over again writing the same thing from a very low point of view. Domains not already served by libraries that are easy to glue are very difficult to get into.
Con Implementation of interfaces are difficult to figure out
Finding out what interfaces are implemented by a struct requires a magic crystal ball. They are easy to write, but difficult to read and trawl through.
Con Performance slowdown because of indirect calls and garbage collection
Practically no meaningful Go application can be written without indirect function calls and garbage collection, these are central to Go's core infrastructure. But these are major impediments to achieving good performance.
Recommendations
Comments
Flagged Pros + Cons
Pro Great runtime performance
GoLang is compiled language, so it is expected to run faster than interpreted language.
GoLang programs may run as fast as ones written in Java.
It is just a matter of time when GoLang compiler will beat Java and will compete with C/C++.
Pro Green threads and channels built-in
The system can easily support tens of thousands (user-space) threads, which can communicate and being synchronized using channels.
This makes it easy to design a system consuming multiple cores (and being scalable) or making asynchronous I/O.
Scalability and asynchronous processing are very important property of systems.
Simplicity of working with threads and channels is very important for beginners.
Pro Simple infrastructure and tooling
Someone may even claim it has too primitive approach, but in reality, when building complex systems, having very well understood infrastructure and tools have a great advantage.
For beginners it is even more important that one needs to spend minimum time for learning how to compile and build your first server in GoLang.
Pro Easy to install and configure; simple to compile software
Go software can be immediately installed, regardless of your operating system, package manager, or processor architecture with the go get command. Software is compiled statically by default so there is no need to worry about software dependencies on the client system. Makefiles and headers are no longer necessary, as the package system automatically resolves dependencies, downloads source code and compiles via a single command: go build
.
Pro Strong static type system
Most of errors related to types are detected during compile time.
The compiler helps to find "stupid" mistakes on the very early stage, which is very helpful not only for a beginner but for any experienced developer as well.
Con Designed to make the programmer expendable
Go was designed for large team projects where many contributors may be incompetent. That Go can still get things done under these conditions is a testament to its utility in this niche. Go's infamously weak abstraction power is thus a feature, not a bug, meant to prevent your teammates from doing too much damage. This also means any team member can be easily replaced by another code monkey at minimum cost. Good for the company, bad for you. The more talented programmers, on the other hand, will be very frustrated by having one hand tied behind their back.
Pro Exceptionally simple and scalable multithreaded and concurrent programming
Goroutines are "lightweight threads" that runs on OS threads. They provide a simple way for concurrent operations — prepending a function with go
will execute it concurrently. It utilizes channels for communication between goroutines which aids to prevent races and makes synchronizing execution effortless across goroutines. The maximum number of OS threads goroutines can run on may be defined at compile time with the GOMAXPROCS
variable.
Pro Demonstrates a unique, simple concept to object-oriented programming.
All types are essentially objects, be they type aliases or structs. The compiler automatically associates types to their methods at compile time. Those methods are automatically associated to all interfaces that match. This allows you to gain the benefits of multiple inheritance without glue code. As a result of the design, classes are rendered obsolete and the resulting style is easy to comprehend.
Pro Performance is on the order of C and Java
Go is blazing fast, but easier to write than Python, JS, Ruby, or many other dynamic languages.
Pro Support of OOP and duck typing
Interface based polymorphism and structural compatibility of interfaces make it easy to extend the system/application, to reuse the code and to refactor.
Basically, it allows to build less coupled architecture.
The OOP support is very simple comparing to other OOP languages like Java/C++. It is relatively easy to understand and it almost does not have surprises. OOP in GoLang is a combination of two clear concepts: structs and interfaces. Structs can be just composed, while interfaces defines behavior. It is not only very simple approach but actually very right implementation of polymorphism. In other languages it will take a lot of time to a beginner not only to learn OOP support but also (what is even more important) to learn how to use it and when not to use it.
GoLang encourage to use OOP in more right way.
Having the minimal and clear concept of OOP, it also makes it very powerful tool of creating abstraction, sometime it is even more powerful than in C++/Java.
Pro Demonstrates a unique, simple concept to object-oriented programming
All types are essentially objects, be they type aliases or structs. The compiler automatically associates types to their methods at compile time. Those methods are automatically associated to all interfaces that match. This allows you to gain the benefits of multiple inheritance without glue code. As a result of the design, classes are rendered obsolete and the resulting style is easy to comprehend.
Out of Date Pros + Cons
Con Default package manager doesn't allow versioning of libraries
This mean that when using go get
we will always fetch HEAD
of remote repo. There are however 3rd party solutions for that problem like repository hacks and managers that tries to mimic lock file.
Con Initial setup of working environment is non trivial
We need to set up some environment variables ($GOPATH
and adjust$PATH
at least). However in most cases it is one-time setup.
Pro Great language for building networking services
Go was started as a systems language but now it has fully committed in the niche of networking services. This has been a brilliant move by Go because it allows them to capitalize on the immense talent of the Go engineering team (who are in the most part network engineers).
In a world dominated by Java EE and slow scripting language, Go was a breath of fresh air and it continues to be one of the most powerful languages if you want to build networking services.
Pro Simplified C-like syntax that is as easy to read and write as Python
The language is designed in a manner that seems logical. Syntax is simplified to reduce burden on the programmer and compiler developers.