This page is no longer maintained — Please continue to the home page at www.scala-lang.org

scala code format

3 replies
Ishaaq Chandy
Joined: 2009-02-16,
User offline. Last seen 42 years 45 weeks ago.
Hi all,
Not strictly a language question but I wanted to know if there is a de-facto code formatting style for scala - or do people generally just wing it to make their code look pretty (or not, as the case might be)?

I ask because at my day job our team is very obsessive about making sure that all our Java code goes through checkstyle and we set up our IDEs to conform to the same formatting rules.

Ishaaq
vpatryshev
Joined: 2009-02-16,
User offline. Last seen 1 year 24 weeks ago.
Re: scala code format
I more or less inherit the ideas from Java; not sure about spaces between type and value parameters, and in folds, do I need a space between two parens; the rest is kind of standard (at least for a Java programmer).

2009/2/18 Ishaaq Chandy <ishaaq@gmail.com>
Hi all,
Not strictly a language question but I wanted to know if there is a de-facto code formatting style for scala - or do people generally just wing it to make their code look pretty (or not, as the case might be)?

I ask because at my day job our team is very obsessive about making sure that all our Java code goes through checkstyle and we set up our IDEs to conform to the same formatting rules.

Ishaaq



--
Thanks,
-Vlad
manojo
Joined: 2008-12-22,
User offline. Last seen 3 years 3 weeks ago.
Re: scala code format
I usually use 2 spaces of indentation (default eclipse value). I also try as much as possible to have a line contain max 80 characters, but I guess that's personal and also depends on your screen size.

On Wed, Feb 18, 2009 at 9:00 PM, Vlad Patryshev <vpatryshev@gmail.com> wrote:
I more or less inherit the ideas from Java; not sure about spaces between type and value parameters, and in folds, do I need a space between two parens; the rest is kind of standard (at least for a Java programmer).

2009/2/18 Ishaaq Chandy <ishaaq@gmail.com>
Hi all,
Not strictly a language question but I wanted to know if there is a de-facto code formatting style for scala - or do people generally just wing it to make their code look pretty (or not, as the case might be)?

I ask because at my day job our team is very obsessive about making sure that all our Java code goes through checkstyle and we set up our IDEs to conform to the same formatting rules.

Ishaaq



--
Thanks,
-Vlad

Ricky Clarkson
Joined: 2008-12-19,
User offline. Last seen 3 years 2 weeks ago.
Re: scala code format
I often use a 7" screen and it copes with 120 char-wide code.  What is your monitor?  A postage stamp? :)

2009/2/19 Manohar Jonnalagedda <manojo10386@gmail.com>
I usually use 2 spaces of indentation (default eclipse value). I also try as much as possible to have a line contain max 80 characters, but I guess that's personal and also depends on your screen size.

On Wed, Feb 18, 2009 at 9:00 PM, Vlad Patryshev <vpatryshev@gmail.com> wrote:
I more or less inherit the ideas from Java; not sure about spaces between type and value parameters, and in folds, do I need a space between two parens; the rest is kind of standard (at least for a Java programmer).

2009/2/18 Ishaaq Chandy <ishaaq@gmail.com>
Hi all,
Not strictly a language question but I wanted to know if there is a de-facto code formatting style for scala - or do people generally just wing it to make their code look pretty (or not, as the case might be)?

I ask because at my day job our team is very obsessive about making sure that all our Java code goes through checkstyle and we set up our IDEs to conform to the same formatting rules.

Ishaaq



--
Thanks,
-Vlad


Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland