Style Guide

Software Engineering at Driver

This guide recommends stylistic and architectural best practices, designed to make your code easier for others to understand. It offers guidelines not rules, and there are situations in which the advice offered should be actively ignored.

Scala

Introduction

Writing programs in Scala is fun. It enables developers to write concise code that is free of boilerplate and enables readers to focus on business logic. It does this in two principle ways. First, it encourages a functional programming style, but still makes it easy to fall back to an imperative approach when needed. Second, it has a strong typesystem that is strict and sound enough to help catch many classes of programming errors at compile time, yet is unobtrusive enough to enable developers to work quickly and without requiring an IDE.

Scala is considered to be an “unopinionated” language, and many styles are seen across multiple organisations. Our approach to idiomatic Scala is the following:

As an extra benefit, we encourage libraries to be compilable with ScalaJS and Scala Native.

Guidelines

Other Resources

Simple Made Easy, by Rich Hickey. A great talk about the differences between “Simple”, “Complex”, “Easy” and “Hard”, and how to write simple programs.