You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@griffin.apache.org by ZQY <zh...@gmail.com> on 2018/04/25 10:25:58 UTC

Discussion for Scala code convention: public methods type annotation

Hi griffin developers,

After a few reviewing the core Scala code in Griffin, I strongly suggest
the Scala source code should follow at least following convention:

All public methods (and some public fields) should specify return types

while public fields type annotation may be treated accordingly, public
methods type annotation is a must
It makes the a lot of benefits, and it is the de facto convention which we
could see from different important source:

http://docs.scala-lang.org/style/declarations.html#methods
http://docs.scala-lang.org/style/declarations.html#fields
https://blog.jetbrains.com/scala/2016/10/05/beyond-code-style/
http://spark.apache.org/contributing.html#Return%20Types

Regards,
Qiyuan