Around 10,000 developers who use the Go programming language to build systems have given their feedback on the Google-backed language in Golang’s 2020 developer survey.
Go has been used at AWS, Netflix, American Express, Salesforce, Stripe, Twitter, Uber, and Dropbox among others. According to developer analyst RedMonk’s Q1 2021 language rankings, Go is the 16th most popular language, but it also dropped one spot from RedMonk’s July 2020 ranking.
Unsurprisingly, adoption of Go in the tech sector showed the strongest growth, rising from 43% in 2019 to 46% in 2020. The media and gaming category was down from 9% in 2019 to 7% in 2020. Other categories, including retail, telecommunications, healthcare, education, transport, public sector, energy, and manufacturing, remained unchanged. Developers in these sectors represented less than 6% each. Nearly three-quarters of the survey respondents worked in software development. The majority do their Go development on Linux or Mac OS, although Linux is trending down slightly and Mac OS is growing.
SEE: Managing and troubleshooting Android devices checklist (TechRepublic Premium)
Developers who’d used Go for two to four years were the largest cohort, representing 33% of all respondents. The majority of respondents felt productive in Go in less than three months (64%), with 81% feeling very or extremely productive in Go.
“Almost half (48%) of respondents have been using Go for less than two years. In 2020, we had fewer responses from those using Go for less than a year,” noted Google user experience research, Alice Merrick.
Work is the predominant place where developers use Go. A full 76% said they used Go at work, while 62% said they use Go outside of work. Just over half (53%) said they program at work in another language.
Some 70% of respondents said they used Go for developing software and applications, while 10% reported using Go to design IT systems and architectures, while 6% report using Go to over see cloud, applications, architecture and deployment.
Google engineers Robert Griesemer, Rob Pike, and Ken Thompson hatched Go in 2007 and Google released version 1.0 of Go in 2012. Pike has called Go the “language of cloud infrastructure” and it is tightly affiliated with Google Cloud, container software from Docker and Google’s Kubernetes container management software.
But one of the biggest complaints among developers who use Go is its lack of “generics” or generic types.
Of the 1,162 respondents who said they would use Go more if it had an extra feature, 88% cited generics as that feature – far ahead of the 58% who reported better error handling, and the 44% citing null safety as the missing feature. Also, the top challenge respondents faced when using Go was its lack of generics (18%).
Generics could, however, become a feature of Go in 2021. In January, the Go community released a proposal to finally add generics to Go.
“Generics can give us powerful building blocks that let us share code and build programs more easily,” wrote Ian Lance Taylor, a software engineer at Google.
“Generic programming means writing functions and data structures where some types are left to be specified later. For example, you can write a function that operates on a slice of some arbitrary data type, where the actual data type is only specified when the function is called. Or, you can define a data structure that stores values of any type, where the actual type to be stored is specified when you create an instance of the data structure.”
SEE: Programming languages: Microsoft TypeScript leaps ahead of C#, PHP and C++ on GitHub
Taylor also outlines the challenges of introducing generics to Go, and explains why it hasn’t been added yet despite it being a top request for over a decade now.
“Although generics have clear use cases, fitting them cleanly into a language like Go is a difficult task. One of the first (flawed) attempts to add generics to Go dates back all the way to 2010. There have been several others over the last decade,” he said.
Taylor says that if the proposed design is accepted, the project hopes to implement it by the end of 2021, possibly in the Go 1.18 betas.