
Cracking the code
The adoption of more coding languages and an embrace of open source approaches to development are having a profound impact on the online gambling industry, Scott Longley reports

There is a touch of the Rimowa luggage catalogue when it comes to talking about ideal code bases; it has to be adaptable, flexible, able to handle frequent changes and, most of all, it must be lightweight.
As for the world of global air travel, so for coding. If the gambling industry is looking for potential scapegoats for the monolithic state of much of the legacy technology it employs, it could do worse than look, in large part, to the code it is employing. Particularly the number one code Java.
“Java codebases are traditionally large and brittle,” says Andrew Deane, systems development manager at bet365. “Developments in one area tends to cascade through the codebase causing large amounts of change and testing. This increases the time to market.”
This cascade effect helps explain the move to employ newer code languages that sit outside the top 10 of the Tiobe Programming Community Index (see ‘Tiobe or not to be’ boxout) which is used as a measure of the popularity of coding languages as measured by the world’s most popular search engines.
“Switching to terse and lightweight languages such as Erlang (number 32 in the September Tiobe Index) and Go (number 17) reduces the fallout from required changes and limits delivery timescales,” Deane says.
“The reduction of timescales allows us to scale the development, in effect getting more for less.” Regardless of language, the new coding landscape is now about style and approach, Richard Drinkwater, head of technology for Sky Betting & Gaming’s bet trading operation, says.
“We’ve seen a change in the way people programme with JavaScript for front-end applications,” he says. “Many teams have been taking a more functional-programming approach, leveraging declarative coding styles and pure-functions to help build composable applications.”
Open all hours
The history of open-source software development stretches back many decades and it has generated a movement impacting every corner of the internet economy.
“You get so much for free nowadays,” says Max Francis, founder of gaming technology start-up Black Cow Technology, and who had previously worked at OpenBet (then Orbis) for over a decade.
For him the open-source movement is a sweet shop where the doors have been flung open on a wealth of enterprise grade libraries and features developed by the community or previously developed by companies before being released generally.
He cites examples such as the Postgres database system, Bootstrap, the web-page layout system developed by Twitter and largely responsible for the layout of pretty much every web page today, and React, a user interface library developed by Facebook.
“JavaScript libraries such as React and Redux are effectively languages on top of a language which give the programmer very flexible capabilities for building applications,” adds Francis.
“So the change in the last few years is that the developer’s question is now ‘what open source libraries do I use?’ rather than ‘which language do I use?’.”
Me, myself and I
A significant corollary of open source is that no-one now needs to work in isolation. In a world of Stack Overflow – the prime source for open source coding and development help – a myriad of blogs and documentation websites have emerged containing helpful information.
“The golden rule any developer will follow when solving a problem today is ‘there will already be a solution to this problem online somewhere – probably better than anything I could come up with’,” says Francis.
“Developers rarely refer to books anymore – it’s far faster and the answers will be more useful if you simply Google your query. Plus, shared online resources such as Stack Overflow have the additional advantage that published answers will have been peer-reviewed by other developers and tweaked by the online community: less efficient solutions will be down-voted.”
It is hard to overstate the effectiveness of this change. “Every developer has access to ready-made solutions to problems which have been reviewed and updated by developers all over the world.”
The flow through to the gambling industry is that it is now easier and cheaper to achieve development aims as the infrastructure improves around it. In a sense, the scaffolding is now all there.
“Pretty much any concept was always achievable, but it was always a question of time and money,” says Peter Sherman, head of development at digital marketing agency Two-Up Digital.
“Newer coding languages will allow you to achieve things faster as their built-in functions keep up better with current trends.”
A modular home
Modern systems are now built as separate and purpose-built services such as a trading service, bet placement, settlement, cash out and the rest. It makes systems more adaptable.
“These services are simply consumers of information from other services and in turn suppliers of information to other services,” Sherman adds.
“They will run around a central messaging bus – Apache Kafka has become very popular for this and is open source – which the data is sent to and then any other services can consume it from there.”
It is a set-up which comes into its own when it comes to coding updates. Sherman says: “If you’re only making a change to your liabilities service, you could probably leave the rest of the system up taking bets and the service will just consume any messages that it missed once it is restarted and catch up.”
Compare this to the other existing models of having millions of lines of code sat around a huge monolith of a database. “Any significant change to the database will require you to be down for two-to-three hours,” he adds.
Drinkwater similarly suggests Sky Bet has shifted towards “containerisation” and tools such as Docker and Kubernetes, changing the way the company builds and services its applications.
“We’ve recently moved our football trading platform onto Kubernetes and we are now able to deliver new types of market to our customers vastly quicker and with a much lower operational overhead.
“This is allowing us more time to invest in the improving customer experience.”
Spikes
One company working closely with the gambling industry in the arena of coding soon after the eponymous coding language was released as open source with the aim of helping companies successfully adopt the technology.
Francesco Cesarini, founder and technical director at Erlang Solutions, says that the move to utilising different coding for differing aspects of any system can help address the tangled issue of legacy technology.
The gambling industry is being affected by two areas of innovation, first around vertical scalability and secondly in terms of developments in distributed systems.
“In an ideal world, you would want your code executing on a 32-core computer to run twice as fast on a 64- cores. Bottlenecks in the virtual machine are being removed, and its code is being constantly optimised.”
The next challenge is connecting the systems and guaranteeing consistency of data. “Large online gambling systems have the same peak loads every Saturday which Amazon has (once a year) on Black Friday but the prices are changing every second,” he says.
“How do you distribute these prices on hundreds of computers and guarantee the same value while not affecting the throughput of their transactions?
“A lot of research is being done in these areas, and as the industry starts applying the results, we will be seeing our systems handle even more complex operations, scale even further while retaining or reducing response times.”
Deane from bet365 is a fan of Erlang. He says the company has taken an alternative path to building a platform that can “absorb the shock of millions of customers arriving in unison” but without degrading the experience for each of them.
“Our approach is to develop simple, robust components out of which we compose the platform,” he says. “Again, this shrinks the codebase, allowing for reduced development times.”
Game time
Such an approach is transformative not just for sports, but also for gaming. For Francis, the idea of having to go out and hire slot machine developers goes out of the window.
“Gambling-specific skills and experience are not required so much because the tools are the same open source libraries in use everywhere,” he says.
“Gambling software suppliers can simply hire great developers with skills in the open source libraries they use – which developers will be using everywhere.”
At iSo_ Bet Michael Probert, head of business development, agrees that the “jump” to HTML meant that new collaborative web development tools and techniques could be employed, which allowed for more outsourcing and a higher degree of code quality.
With games, that means that suppliers can now provide better performing games than before. “They now have the choice to either keep it simple or push the technology to deliver highly interactive products, ranging from 2D games, to actual 3D live rendering games, and even virtual and augmented reality,” he says.
“The coding environment has developed greatly,” he adds. “We are now able to build a game once and run it across most devices and browsers, taking advantage of hardware acceleration, which is a relatively recent development that allows browsers to use hardware in order to display graphically rich apps.”
Automated builds, automated tests, design tools, profiling tools are now used “on a daily basis”. “Basically, web-based games development is catching up with traditional app-based game development,” he says.
Break glass to open
Taking its place alongside the advances in open source as another vital spur for future innovation is the theory of test-driven development. Drinkwater says Sky Bet has embraced the concept with the side effect that the work becomes a “more pleasant and approachable task”.
For Francis, it means that developers now get to automate the test process as they write it leading to a huge leap in code quality and reliability.
“Any development organisation following a test-driven development methodology has superior confidence in their code-base and knows they can make changes and additions without fear of breaking something,” he says.
“Most significantly, test-driven development has meant that we can be confident in a high level of quality in our code.
“The suite of tests we developed along with the so_ ware is run automatically by the system every time we make a change – so we know our change hasn’t broken something somewhere else.”
The coding ecosystem will benefit all participants, or at least that is the promise. A rising tide floats all boats and aspects of crowd theory mean that the chances of the best solutions and the best fit being found are optimised.
Deane at bet365 says: “Having a diverse set of development languages allows us to take the best from each, and use the correct approach for the specific job in hand.
“Each language adopts a different programming paradigm from the next, meaning we have all options available to us when solving problems.”
For Cesarini at Erlang, the direction of travel is settled even if the eventual destination is as yet a way off. “What is influencing the nature of coding is the need for horizontal scalability through containers or virtualisation, the lack of granular control of your cloud infrastructure, and when running on the bare metal, dealing with more powerful hardware,” he says.
“These are all challenges which need to be addressed and influence coding styles and approaches.”
Race for the prize
Given this backdrop, there is abundant optimism about what comes next when it comes to the gambling industry. Drinkwater says that the shift to a more functional approach has enabled a more rapid evolution of the customer experience.
“By moving control of the presentation closer to the customer, we’ve also unlocked the ability to deliver a much more targeted and personalised experience – a massive shift from the one-size-fits-all experience that was delivered with server- side rendering in the past.”
“It has got to mean more innovation surely,” says Francis. “I think we are due another leap. Changes don’t tend to come as a steady accumulation – we experience punctuated jumps to new levels, and each new level very quickly becomes home and we wonder how could it ever have been otherwise?”
Cesarini is forthright in stating what he thinks the future holds for operators and suppliers relying on teetering coding stacks and struggling to keep pace with the changing world around them.
“The problem the industry has with legacy systems will eventually be a thing of the past for two reasons,” he says. “One, competition will drive operators to seek out the right tools for the job. Two, those who fail to adopt the right tools for the job will lose out to competitors who got there first.”