It’s mostly a question of convention. Methods with empty parameter lists are, by convention, evaluated for their side-effects. Methods without parameters are assumed to be side-effect free. That’s the convention.
More Related Contents:
- To check whether my list fulfils the parameters set out in nested loop in scala function
- What is the formal difference in Scala between braces and parentheses, and when should they be used?
- Understanding implicit in Scala
- What does param: _* mean in Scala?
- Error with varargs for function-objects in Scala?
- Why does one select Scala type members with a hash instead of a dot?
- Scala: Write a function to swap a number in place without using temporary variables
- Composing Option with List in for-comprehension gives type mismatch depending on order
- NullPointerException in Scala Spark, appears to be caused be collection type?
- Functions vs methods in Scala
- What does setMaster `local[*]` mean in spark?
- How to split a dataframe into dataframes with same column values?
- How to use regex to include/exclude some input files in sc.textFile?
- Valid identifier characters in Scala
- How to find spark RDD/Dataframe size?
- When to use parenthesis in Scala infix notation
- Stream vs Views vs Iterators
- Run custom task automatically before/after standard task
- PHP syntax for dereferencing function result
- What’s the easiest way to use reify (get an AST of) an expression in Scala?
- How to force IntelliJ IDEA to reload dependencies from build.sbt after they changed?
- Doing something before or after all Scalatest tests
- Scala : fold vs foldLeft
- Update operations on a Scala Case Class
- Difference between Iterator and Stream in Scala?
- Spark RDD default number of partitions
- Why does Spark RDD partition has 2GB limit for HDFS?
- Creating a method definition tree from a method symbol and a body
- How do I parse command line arguments in Scala? [closed]
- Futures / Success race