Originate Guides - Scala
Welcome to Originate's Scala Guide. This guide contains recommendations for formatting conventions, coding style, and best practices based on person-decades of experience gathered across innumerous Scala projects.
The guide is organized as follows:
The first section, "Code Formatting", covers code layout conventions, i.e., guidelines that do not alter the meaning of a program:
- The section itself highlights the main points of the official Scala Style Guide. Reading the official guide completely is required.
- The subsection "Additions and Deviations" contains the points where we differ from the official guide, plus some topics that are not covered by it. To ease on-boarding and favor consistency, we try to deviate as little as possible from the official guide.
The second section, "Best Practices" covers rules that may change the meaning of your code:
- "Additional recommendations", for the most part, are required rules that must be followed unless there is a very good reason not to. Failure to fully obey these conventions may introduce errors, degrade performance, or create maintenance headaches.
- "Tips & Tricks" are mostly friendly reminders that may not apply in all situations. Always keep them in mind and use your best judgement.
- "Additional Remarks" are general hints that are always helpful to remember.
- Finally, the "Reference" contains recommended further reading.
Static Analysis Tools & Configuration
A skeleton project accompanies the guide. It encodes and enforces as many best practices as currently available tools allow us. Try to use as much of its default configuration as you can on your Scala projects.