File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -273,6 +273,15 @@ for multiple reasons, most notoriously
273
273
For an in-depth treatment of types vs. classes, see the blog post
274
274
[ "There are more types than classes"] ( https://typelevel.org/blog/2017/02/13/more-types-than-classes.html ) .
275
275
276
+ ### Should I declare my parameterless method with or without parentheses?
277
+
278
+ In other words, should one write ` def foo() ` or just ` def foo ` ?
279
+
280
+ Answer: by convention, the former is used to indicate that a method
281
+ has side effects.
282
+
283
+ For more details, see the Scala Style Guide, [ here] ( https://docs.scala-lang.org/style/naming-conventions.html#parentheses ) .
284
+
276
285
### How can a method in a superclass return a value of the “current” type?
277
286
278
287
First, note that using ` this.type ` won't work. People often try that,
You can’t perform that action at this time.
0 commit comments