One of the things about Scala which has always bugged me is the
lack of an official style guide. There is simply no "right" way of doing things, syntactically speaking. Over the years, the Scala community has attempted to fill the void (as it were) by defining a set of unofficial, word-of-mouth conventions. Things like when to add parentheses to no-arg methods or what the preferred function literal definition style may be.
This works fine for experienced Scala community members, but newcomers to the language are understandably baffled. This also causes a great deal of frustration on larger Scala projects with less-experienced Scala developers as some code will be stylized in one way, while other code will use a different convention.
A few months ago, I decided that I had run into this problem one too many times, and so I took the time (with the generous support of my employer) to create a full (-ish) style guide for Scala syntax, naming conventions and project management. The guidelines it contains are based on what I have heard from the community and do not necessarily reflect my own preferences (e.g. function types). When in doubt about a particular convention, I have alternately looked at Martin Odersky's code or simply relied on my own knowledge of Java, C#, Standard ML and Haskell conventions. Comments and criticisms are very welcome.
I would like to submit this guide for adoption by the larger Scala community. I know that sounds like I'm trying to foist my opinions on everyone else, but I'm really just hoping to get the ball rolling. Ideally, this guide should be used as a starting point from which a proper, officially-blessed and better-typeset guide can be fashioned. Until that happens, I'm more than happy to host the guide at Code Commit, incorporating any revisions the community as a whole deems necessary.
The source for the guide is in reStructuredText, which is easily convertible to distributable formats like HTML, LaTeX, TWiki markup and more. For convenience, I have compiled the guide to a PDF (using
rst2newlatex and
pdflatex) and uploaded it along with the source. The document does not include a license declaration, but you can pretty much consider the material to be Public Domain.
Enjoy!
Daniel