You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _overviews/FAQ/index.md
+9Lines changed: 9 additions & 0 deletions
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,
0 commit comments