Golang Project Structure

Tips and tricks for writing and structuring Go code

Some Findings From the 2021 Go Developer Survey

Language

  • unknown

by

For the past six years, Google has run an annual Go Developer Survey in order to understand more about what the community thinks and how it feels about recent changes to the language. The survey also helps to keep us informed about any problems or concerns that have arisen and gives us an opportunity to celebrate achievements.

The results for the 2021 Go Developer Survey have just been released. The initial research was conducted over three weeks between October 26 and November 18 at the end of last year.

A man's hand filling in a paper survey with a pen.
Surveys were traditionally conducted using paper forms. Now they can be done online with the results stored in databases and automatically analysed by computer code.

The number of respondents to the survey was larger than ever: almost twelve thousand different developers took part. They did not all have to answer every single question in the survey, however, so some questions have fewer than half that number of respondents. Even so, to have so many Go programmers sharing their opinions about the language and its ecosystem in a single survey is an amazing achievement.

In this post, I’m going to look through some of the most important and interesting findings from the survey.

Satisfaction With the Go Programming Language Is Extremely High

As you can see on the chart below, the vast majority of developers who use Go in their work consider themselves to be either “very satisfied” or “somewhat satisfied” with the language. More importantly, only eight percent of developers expressed a negative or neutral opinion of the Go programming language, which is, of course, a tiny percentage.

Satisfaction levels with the Go programming language from the 2021 Go Developer Survey.

So it’s important to remember that even whenever there’s genuinely heated controversy about syntax, such as the recent introduction of generics, most developers only express such strong opinions because they care so much about Go and want to ensure its future success.

Indeed, eighty-one percent of respondents to the Go Developer Survey affirmed that they were “confident with the long-term direction of the Go project”. This is a real vote of confidence that ought to give reassurance to anyone currently learning or working with the language.

What Kind of Projects Are Go Developers Working On?

One of the major reasons that the Go programming language was originally created was in order to make it easier for coders to build and maintain highly performant HTTP servers. It is not surprising, therefore, that many developers who responded to the Go Developer Survey said that their most recent project was a server or microservice.

What is surprising is just how much these sorts of projects tend to dominate the landscape: forty-nine percent — almost half — of developers said that they last worked on an API (or RPC service) in Go. Another ten percent said that they build a web server, something similar to the program that delivered the HTML page that you’re reading now.

Data-processing software and command-line applications were other common uses for Golang. But you needn’t follow the crowd: Go is a highly versatile language and can adapt easily to bespoke or unusual projects.

As might have been imagined, the survey found that mobile apps are rarely built by Go developers. This may be because other programming languages are already used to build native apps for the most popular mobile operating systems: Java or Kotlin for Android and Objective-C or Swift for iOS. But it is perfectly possible to build both Android and iOS apps entirely in Go without using any other programming language: there is an experimental package designed for exactly that purpose.

Software Development Remains a Male-Dominated Industry

I don’t intend to get into any contentious issues of gender politics here, but it is useful to note how representative of — or distinct from — wider society Go developers may be.

As in previous years, the vast majority (ninety-two percent) of Go developers are men. This is not unique to the Go community: it is equivalent to the overall proportion of software developers in general who are men.

There can be all kinds of reasons why these sorts of disparities continue to exist between different groups of people. Sometimes discrimination is at play, but sometimes people simply gravitate towards certain professions as a result of their own interests, life-history and instincts. It is difficult to disentangle all of the complicated social and societal causes and effects at play.

There are a large number of organizations and community groups that are encouraging more women and girls to get into software development, so it is possible that we will see more female representation in future versions of the Go Developer Survey.

Women Who Go is one of the biggest networks that already supports thousands of women around the world to improve their skills in Golang. The larger Women Who Code charity aims to mentor females who are employed in all kinds of technology-related roles or who want to transition their careers into those areas.

It’s Easy to Learn How to Code in Go

Eighty-eight percent of all developers felt that they were able to achieve a high level of productivity. What is more impressive, however, is that seventy percent of coders who’d been using Golang for less than three months felt that they were able to achieve an equally high level of productivity.

A similar number of respondents felt like they could easily enter into a state of “flow” when programming in Go.

When your creativity is activated and you’re focused on a single task, it can feel like your thoughts are flowing through your mind like water in a river.

“Flow” is a concept that was most clearly defined by the Hungarian-American psychologist Mihaly Csikszentmihalyi. He described as a state of complete concentration, when you’re totally absorbed in the task that you’re working on, without any distractions. In more colloquial language, we talk of people being “on fire” or “in the zone”. It’s almost like the meditative state that others have attempted to achieve through mindfulness.

The following is a quote from Csikszentmihalyi’s book Flow: The Psychology of Optimal Experience:

The optimal state of inner experience is one in which there is order in consciousness. This happens when psychic energy — or attention — is invested in realistic goals, and when skills match the opportunities for action. The pursuit of a goal brings order in awareness because a person must concentrate attention on the task at hand and momentarily forget everything else.

The fact that Go is so easy to get to grips with helps to enable this positive state of mind. There are only twenty-five keywords in Go, making the syntax easy to remember, which means that you can focus more on thinking about how to solve your particular programming problem, rather than struggling with the language itself.

One user on a recent Reddit discussion described Go as the “easiest to learn language I’ve ever come across”. Another claimed that it was possible to get familiar with the fundamentals of the programming language in “at most a week”. While you may find yourself needing to devote a little more time than that to the learning process if you’re a complete beginner and have no experience at all with similar languages, the general consensus is that it’s really not a difficult language to pick up.

Only two percent of respondents in the Go Developer Survey claimed to have learnt the language in school, college or university, so most are picking it up on the job or in their spare time. Ninety percent of developers learnt the language on their own, without any guidance or support from other people; that doesn’t mean, however, that they didn’t use online resources like StackOverflow and this website, which can be some of the most important ways that programmers share knowledge with their peers.

While a small number of maverick developers have been programming with Golang since it first emerged over a decade ago, most have been using the language only in the past couple of years, which makes it clear that our community is continuing to grow and attract new advocates.

Hackers Will Always Love Linux!

Even in these modern days of corporate coding, the hacker spirit is still very much alive. The majority of Go developers prefer the security, adaptability, performance and freedom of Linux. MacOS — which can run many Linux commands — comes a close second.

Windows is, however, slowly creeping up in popularity, and around a quarter of Go programmers are now using it as their primary operating system for development. This may reflect the increased number of people who are using Go overall and the fact that Windows has much more mainstream appeal.

Nonetheless, ninety percent of respondents in the Go Developer Survey said that they compile their code to target Linux machines, even if they actually write it on a computer running MacOS or Windows.

As we saw earlier, Go has a natural advantage when it comes to creating web servers or microservices, and these traditionally tend to run on machines in data centers running Linux. Configuration is generally done at the command-line via SSH or FTP, so those machines have no need for a desktop-style GUI to be installed, allowing them to focus their resources entirely on the important job of manipulating and delivering data.

Which Industries Employ Go Programmers?

The Go Developer Survey shows us that, by far, the largest proportion of professional coders who use Go in their day-to-day work are employed at technology companies, whether small start-ups or behemoths on the scale of Google, Apple, Amazon, Microsoft or Facebook.

Financial-services companies represent the next biggest industry, albeit with just over ten percent of the total. This industry tends to require code that is especially fast and reliable, since large amounts of money are at stake and large-scale disruptions to service can very quickly destroy a company’s reputation. The video below describes how the UK-based Monzo bank (previously known as Mondo) uses Go for all of its core services:

However, the range of other industries represented is really quite diverse, including almost every sector of the economy. Even old-school industries like transportation, retail and education rely on Go programmers to monitor their performance and improve their productivity.

Final Thoughts About the 2021 Go Developer Survey

The results to this years survey have, once again, provided us with a huge amount of useful information. The Go team will use the feedback to guide its work over the coming months.

For example, the module system that was integrated into Go in recent years has made developers think more about dependency management, and this is an area where they’d like the team to continue to make improvements.

It should be noted that there are, however, some issues with Google’s Go Developer Survey. For example, most of the respondents chose to reply after seeing it advertised on the Go Blog: this means that any developers who are less likely to engage with this source may also have been less likely to take part in the survey.

That said, the methodology of the survey did undergo a significant change in 2021 in order to mitigate against this problem: a significant minority of respondents were randomly selected to take part when they used a Go plugin on the VS Code editor. This has helped to reduce the self-selection bias, but it hasn’t eradicated it entirely.

Yet these are minor qualms. We can clearly be confident that the results reflect the views of a significant cross-section of the Go community, and they show that most developers who begin to use the language are pleased to have the chance to work with it.

Go often appears as one of the top ten languages among GitHub users, and its popularity shows no sign of declining, so we can confident that it will be around long into the future.

You can read the Go team’s discussion of the most recent Developer Survey here.

Leave a Reply

Your email address will not be published.