An Introduction to Go for non-Go Developers

An Introduction to Go for non-Go Developers

A brief introduction to Go for programmers who haven't used Go before: Why use it? The standard library. Why Go? Go has become very popular over the past few years, partly because of the simplicity of the language, but perhaps more importantly because of the excellent tooling.

Summary: I’ve presented an introduction to Go a few times for developers who are new to the language – this is that talk serialized as a technical article. It looks at why you might want to use Go, and gives a brief overview of the standard library and the language itself.

A few years ago I learned Go by porting the server for my Gifty Weddings side gig from Python to Go. It was a fun way to learn the language, and took me about “two weeks of bus commutes” to learn Go at a basic level and port the code.

Since then, I’ve really enjoyed working with the language, and have used it extensively at work as well as on side projects like GoAWK and zztgo. Go usage at Compass.com, my current workplace, has grown significantly in the time I’ve been there – around half of our 200 plus services are written in Go.

This article describes what I think are some of the great things about Go, gives a very brief overview of the standard library, and then digs into the core language. But if you just want a feel for what real Go code looks like, skip to the HTTP server examples.

Why Go?

As the following Google Trends chart shows, Go has become very popular over the past few years, partly because of the simplicity of the language, but perhaps more importantly because of the excellent tooling.

Google Trends data for "golang" from 2010 to 2020

Here are some of the reasons I enjoy programming in Go (and why you might like it too):

  • Small and simple core language. Go feels similar in size to C, with a very readable language spec that’s only about 50 pages long (compared to the Java spec’s 770 pages). This makes it easy to learn or teach to others.
  • High quality standard library, especially for servers and network tasks. More details below.
  • First class concurrency with goroutines (like threads, but lighter) and the go keyword to start a goroutine, channels for communicating between them, and a runtime whose scheduler coordinates all this.
  • Compiles to native code, producing easy-to-deploy binaries on all the major platforms.
  • Garbage collection that doesn’t require knob-tweaking (optimized for low latency).
  • Statically typed, but has type inference to avoid a lot of “type stuttering”.
  • Great documentation that is succinct and includes many runnable examples.
  • Excellent tooling. Just type go build to build your project, go test to find and run your tests, etc. There’s CPU and memory profiling, code coverage, and cross compilation – all without external tooling.
  • Fast compile times. The language was designed from day one with fast compile times in mind. In fact, co-creator Rob Pike jokes that “Go was conceived while waiting for a big [C++] compilation.”
  • Very stable language and library, with a strict compatibility promise that all Go 1 programs will run unchanged on later versions of Go 1.x.
  • Desired. According to StackOverflow’s 2019 survey, it’s the third most wanted programming language, so it’s easy to hire developers who want to use it.
  • Heavily used in cloud tools. Docker and Kubernetes are written in Go, and Dropbox, Digital Ocean, Cloudflare, and many other companies use it extensively.

go developer

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How long does it take to develop/build an app?

This article covers A-Z about the mobile and web app development process and answers your question on how long does it take to develop/build an app.

Offshore Software Development - Best Practices

To make the most out of the benefits of offshore software development, you should understand the crucial factors that affect offshore development.

Mobile App Development Company | Web Development & Design Services

WebClues Infotech is a leading website and mobile development services company. We specialize in full stack development services as well as iOS and Andriod app creation.

Tracking a Developer’s Journey From Documentation Visit

Measuring website activity provides only half the story. See how to best track the developer's journey and what funnel stages makes sense for API-first products

Hire Python Developers

Are you looking for experienced, reliable, and qualified Python developers? If yes, you have reached the right place. At **[HourlyDeveloper.io](https://hourlydeveloper.io/ "HourlyDeveloper.io")**, our full-stack Python development services...