Open Source Insider

Aug 21 2019   9:39AM GMT

Golang or go home: how Curve is taking Golang to new heights

Adrian Bridgwater Adrian Bridgwater Profile: Adrian Bridgwater

Tags:

This is a guest post for the Computer Weekly Open Source Insider blog written by Matt Boyle in his capacity as lead software engineer at Curve.

Curve allows users to spend money from all their accounts with one Curve card – and hopes to simplify your finance through one secure mobile app.

Boyle writes…

Emerging only in 2009, Golang is still relatively new and not as widely used as other mainstream coding languages.

This young language was incubated inside Google, and has already been proven to perform well on a massive scale. We wanted to share with you a few reasons why we love Golang (Go) and how Curve is using it.

Go has excellent characteristics for scalability and services written using it typically have very small memory footprints. Because code is compiled into a single static binary, services can also be containerised with ease, making it much simpler to build and deploy. These attributes make Go an ideal choice for companies building microservices, as you can easily deploy into a highly available and scalable environment such as Kubernetes.

Go has everything you need to build APIs as part of its standard library.

It has an easy to use and performant http server out of the box, which eliminates some of the exploration and paralysis that can occur when teams are faced with designing a new project. If you were to use other languages such as Java or Node, this is often a significant obstacle in a team dynamic.

Automated formatter

There’s also another way it makes for smoother group workflow: code formatting is a first class concern, with an automated formatter [Ed: yes, that’s now a word] built into the language. With other languages, a lot of time and energy can be wasted agreeing on code formatting and which style guide to follow.

Go completely removes the need for this conversation.

Go is very easy to learn. Although finding engineers with significant production Go experience can be challenging, at Curve we have had great success with hiring people from Java and PHP backgrounds and upskilling them in Go.

It usually only takes about a week or two to begin actively contributing production-ready code. We have also found that developers end up preferring using Go. It really is simple yet effective: Go favours “what you see is what you get” – which means readable clear code with few complex abstractions.

This makes peer review a much easier task; whether its a colleague’s code or even huge open source projects such as Kubernetes.

We are strong advocates of TDD and Go has a fantastic test framework built into the language. Just by naming a file with _test.go and adding some test functions within that file, Go can automatically run all of your unit tests at lightning speed. This makes TDD easy to learn and use as part of the development cycle.

Kinky, in places

There are still a few kinks to work out, but we’ve found that it doesn’t take away from the functionality of Go.

For example, one particularly contentious feature is that it does not have explicit interfaces. Opinions are divided on this as many developers are used to the concept, but it can make it tricky to determine what interfaces your struct does satisfy. This is because you do not write X implements Y as you may in other languages. However, it is something you quickly learn to be okay with.

Dependency management was also originally overlooked by the team developing Go at Google. As such, the open source community stepped in and created Glide and Dep. Both were admirable attempts at solving dependency management but also came with their own set of problems.

As of Go 1.11, support has been added for modules and this has become the official dependency management tool. This has received mixed feedback, and there is definitely more improvements to be made in this area.

Vibrant open source community

Despite these growing pains, what really takes Go above and beyond is its vibrant community. In London there is a great meetup community that is very welcoming and open to collaboration. Everyone is friendly, helpful and keen to develop Go further, together. The Go open source community is thriving — some game-changing projects such as Istio, Kubernetes and Docker are all written in Go and available to download, contribute to and extend on GitHub.

It is this dynamic and innovative yet straightforward makeup that makes Go the ideal coding language for developing a company like our own.

Curve attended the Gophercon Golang conference in the UK this year… details of the event are shown in the link above.

Boyle: keen on community spirit.

1  Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.
  • ITKE
    All good points, but I have a couple of objections

    - HTTP server as a form of paralysis

    I don't recall ever having this issue, the players in the field are generally well known (Netty, Tomcat etc) and more often than not, these are abstracted away by another library, letting you design to the API, not to the server

     "a lot of time and energy can be wasted agreeing on code formatting and which style guide to follow."

    Generally speaking that's rarely the case in established teams, and it's something that's agreed upon and enforced in a very short time for budding teams

    - "code is compiled into a single static binary..."

    It's a fair point, but one that's about to become moot, with GraalVM

    1,146,765 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: