Re:Eclipse launches new language to cut down Java boilerplat...
by eropple on Friday November 04, 2011 @11:10PM
(#3198768)
This is actually half of the value of it. It allows you to easily change the implementation without breaking the public semantics. Generally speaking, the first-pass practice in Scala is to use public fields and to make them vals (final/C# readonly). Where you need to provide mutability, you use a var. But due to C#-esque properties, you can go from
to (not great code, but illustrative of the point)
The convention is to use empty parents after zero-argument functions that have side effects, much like the ! in Scheme.
[ Parent
| on HN ]
There are no comments on this comment yet.