spark-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shivaram Venkataraman <shiva...@eecs.berkeley.edu>
Subject Re: multi-line comment style
Date Wed, 04 Feb 2015 22:09:54 GMT
FWIW I like the multi-line // over /* */ from a purely style standpoint.
The Google Java style guide[1] has some comment about code formatting tools
working better with /* */ but there doesn't seem to be any strong arguments
for one over the other I can find

Thanks
Shivaram

[1]
https://google-styleguide.googlecode.com/svn/trunk/javaguide.html#s4.8.6.1-block-comment-style

On Wed, Feb 4, 2015 at 2:05 PM, Patrick Wendell <pwendell@gmail.com> wrote:

> Personally I have no opinion, but agree it would be nice to standardize.
>
> - Patrick
>
> On Wed, Feb 4, 2015 at 1:58 PM, Sean Owen <sowen@cloudera.com> wrote:
> > One thing Marcelo pointed out to me is that the // style does not
> > interfere with commenting out blocks of code with /* */, which is a
> > small good thing. I am also accustomed to // style for multiline, and
> > reserve /** */ for javadoc / scaladoc. Meaning, seeing the /* */ style
> > inline always looks a little funny to me.
> >
> > On Wed, Feb 4, 2015 at 3:53 PM, Kay Ousterhout <kayousterhout@gmail.com>
> wrote:
> >> Hi all,
> >>
> >> The Spark Style Guide
> >> <
> https://cwiki.apache.org/confluence/display/SPARK/Spark+Code+Style+Guide>
> >> says multi-line comments should formatted as:
> >>
> >> /*
> >>  * This is a
> >>  * very
> >>  * long comment.
> >>  */
> >>
> >> But in my experience, we almost always use "//" for multi-line comments:
> >>
> >> // This is a
> >> // very
> >> // long comment.
> >>
> >> Here are some examples:
> >>
> >>    - Recent commit by Reynold, king of style:
> >>
> https://github.com/apache/spark/commit/bebf4c42bef3e75d31ffce9bfdb331c16f34ddb1#diff-d616b5496d1a9f648864f4ab0db5a026R58
> >>    - RDD.scala:
> >>
> https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/rdd/RDD.scala#L361
> >>    - DAGScheduler.scala:
> >>
> https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala#L281
> >>
> >>
> >> Any objections to me updating the style guide to reflect this?  As with
> >> other style issues, I think consistency here is helpful (and formatting
> >> multi-line comments as "//" does nicely visually distinguish code
> comments
> >> from doc comments).
> >>
> >> -Kay
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@spark.apache.org
> > For additional commands, e-mail: dev-help@spark.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@spark.apache.org
> For additional commands, e-mail: dev-help@spark.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message