|
|
|
|
|
by oacgnol
5347 days ago
|
|
That's what Scala already does: if a method does not take any args then the parentheses aren't necessary. To quote Odersky: "This convention supports the uniform access principle which says that client code should not be affected by a decision to implement an attribute as a field or method." It makes sense if you want to implement something that may be a field but needs to be computed. |
|
I think the idea of computed fields implemented via methods is better represented via C#-style properties, although I'd prefer to be able to access their methods directly, when suitable.