In 2012, a team of three Google engineers released a new programming language, Go, designed to enable programmers to write code for multiprocessor hardware more quickly. A number of organisations have made use of Golang, include Deliveroo, HM Treasury and Sainsbury’s in the UK.

Betting firm Bet365 is another company on the Golang journey. Eighteen months ago, it did not have any Golang code. Now Alan Reed, head of sports development at Bet365, believes Golang will become one of the company’s core development languages.

He says the main driver for using Golang is performance. “Most large websites have the same needs as Google and we are reaching the limits of our current .Net solutions,” he says. The online bookie needed a way to deliver live sports results with sub-second latency.

Although it has C and .Net skills, Bet365 is used to trying new languages to help it meet business objectives. When Computer Weekly spoke to the company in 2015, it was embarking on a journey with Erlang, a programming language developed in the 1990s by Ericsson for telephone switches.

At the time, the problems telephone switch providers had to deal with were very similar to those experienced when running a sports betting website, such as reliability, scalability and simplicity. The company even went as far as to acquire Riak, a distributed NoSQL technology written in Erlang. in 2016 and contributing the code to the open source community on GitHub, to encourage more enterprise developers to use it.

Why Golang? Reed says: “C and .Net are excellent tools for many jobs, but sport, which sits at the front line of the business, is subject to the fastest change. These languages are too verbose and inflexible to achieve our goals.”

Bet365 began looking at Golang two years ago, says Reed. The language, originally developed by Google, is good for gluing bits of code together, he says. Its core strengths as a programming language are its memory management and concurrency features, which help Bet365 to run real-time betting. “We are very scared of memory leaks,” Reed adds.

Large sporting events attract a lot of interest from people wanting to place a bet, which leads to peaks in demand for certain services on the website. “We want to personalise our customers’ experiences,” says Reed. “Customers are looking to place a bet and check their balance.”

Golang is able to manage such huge demands in betting, he says. “Customers place a bet two minutes before a match ends. This leads to areas of data where there is concentrated activity. If something is going on in a game, all customer activity is focused on one set of data.”

Golang helps Bet365 solve the “peakyness” of customer activity in a predictable way, says Reed.

Another benefit of Golang is its long-term maintainability, he adds. “We have large development teams and our software has a lifespan of six to eight years. Golang has allowed us to write code in a very consistent way.”

Reed says this makes the code highly maintainable. Comparing it to .Net, which relies on design patterns, he says: “Golang is restrictive. Its language syntax only offers a very specific way to code something.”

So maintaining code should be easier because there is only one way to program something. In a sense, it offers “guard rails”, says Reed.

The first product that Bet365 released using Golang was Bet Builder, which was launched towards the end of 2017. Golang was also used to create a live betting product for the Fifa World Cup, and enabled Bet365 to add a search capability, enabling customers to find something to place a bet on.