Scala coding styles and conventions?

后端 未结 7 823
野的像风
野的像风 2020-12-30 04:10

I think Scala goes too far from simplicity, like its syntax. For example Martin Odersky wrote the method in his book :

def calculate(s: String): Int =
  if (         


        
7条回答
  •  执笔经年
    2020-12-30 04:56

    "If the method grows it becomes very painful to read the code". I think part of the answer is that methods should not grow. The functional programing style is to have many small methods.The calculate method is already on the large side.

    To answer the more general questions about style guides for Scala programing: Here's a representative example.

提交回复
热议问题