Wednesday, November 25, 2009

Good Scala Style

This topic is a bit of a departure from the normal but is very important. The goal of these posts has not been(necessarily) to introduce good coding style, instead to introduce the different tools at your disposal. There have been some good styles to follow and some bad ones (hopefully more good than bad.) Today is mainly a link to a project and document that is documenting a style guide for Scala programming. I highly recommend taking a look at it and a big thanks to Daniel Spiewak for spearheading this project, although I think it has now grown beyond just Daniel so thanks to the other contributors as well.

Github project: http://github.com/davetron5000/scala-style
HTML - http://davetron5000.github.com/scala-style
PDF - http://davetron5000.github.com/scala-style/ScalaStyleGuide.pdf

Thanks again for a wonderful resource.

3 comments:

  1. This is useful, and I think sorely needed since (as a newbie to the language) some people's Scala code looks like a personal DSL they've invented.

    Case in point: scala.Enumeration has a Value method to create a new enumeration value. But the capital V implies it's a class - I can't tell you how confusing this is! Why couldn't they call it value, or even value() ? And it's compounded by the fact that the type of your enumeration values is also called Value!

    I bet whoever made that decision thought it was cool. But it only takes a few bad decisions like that to sink a language before it's got going...

    ReplyDelete
  2. Hello,

    good posts! This is something I missed.
    I thing the guide good for all scala devs.
    It delivers some insights.

    best regards

    ReplyDelete
  3. nextValue() or newValue() or createValue() would be even better.

    ReplyDelete