Harder than scripting, but easier than programming in C

So Much More

There is so much more I could talk about: for example, the fact that – instead of typical object orientation – Go only offers structs as instance variables. It addresses them with method-style functions. Or what about the ingeniously simple reader interface that lets functions process data transparently, no matter if they come from a file, an Internet connection, or a string? Using code reflection to examine your code's data structures at runtime would be another topic, or the elegant defer statement to free up resources at the end of a function, and much more, but that will have to be deferred to another time for lack of space.

At the end of the day, Go is a very well thought out language that builds on the tradition of time-honored and overwhelmingly successful languages such as C, but eliminates their shortcomings and gives programming professionals a modern tool for the 21st century.

Infos

  1. Go tutorial: https://tour.golang.org
  2. Donovan, Alan A. A., and Brian W. Kernighan. The Go Programming Language. Addison-Wesley Professional, 2016, https://www.pearson.com/us/higher-education/program/Donovan-Go-Programming-Language-The/PGM234922.html
  3. Listings for this article: ftp://ftp.linux-magazine.com/pub/listings/linux-magazine.com/250/
  4. "Getting to Go: The Journey of Go's Garbage Collector" by Rick Hudson, The Go Blog, July 12, 2018, https://blog.golang.org/ismmkeynote

The Author

Mike Schilli works as a software engineer in the San Francisco Bay Area. Each month in his column, which has been running since 1997, he researches practical applications of various programming languages. If you email him at mailto:mschilli@perlmeister.com he will gladly answer any questions.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Rat Rac

    If program parts running in parallel keep interfering with each other, you may have a race condition. Mike Schilli shows how to instruct the Go compiler to detect these conditions and how to avoid them in the first place.

  • Simultaneous Runners

    In the Go language, program parts that run simultaneously synchronize and communicate natively via channels. Mike Schilli whips up a parallel web fetcher to demonstrate the concept.

  • Fighting Chaos

    When functions generate legions of goroutines to do subtasks, the main program needs to keep track and retain control of ongoing activity. To do this, Mike Schilli recommends using a Context construct.

  • Motion Sensor

    Inotify lets applications subscribe to change notifications in the filesystem. Mike Schilli uses the cross-platform fsnotify library to instruct a Go program to detect what's happening.

  • Progress by Installments

    Desktop applications, websites, and even command-line tools routinely display progress bars to keep impatient users patient during time-consuming actions. Mike Schilli shows several programming approaches for handwritten tools.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News