"Model 2" prototype status

Rémi Forax forax at univ-mlv.fr
Thu Aug 6 20:30:51 UTC 2015

Le 6 août 2015 18:56:35 CEST, Simon Ochsenreither <simon at ochsenreither.de> a écrit :
>I'm not saying that duplicating static members is without benefits,
>when it comes to ease of implementation.
>The problem with this approach is that it vastly complicates the mental
>model of
>everyone learning or using Java.
>Today, people have to distinguish between members which are per-class
>members which are per-instance.
>(Java doesn't separate these members, but allows mixing them freely at
>declaration site. From my experience with beginners learning to
>program, this is
>pretty bad already.)

yes, it's bad and an usual issue unless you introduce static after 5 or 6 weeks courses.

but accessing to a field or a local variable with the same syntax is far worth IMO.

>With duplicated members, we would put the implementation details of
>classes right in front of users, and force them to learn another layer.
>We would have
>- members per class without class-level Generics or with erased
>- members per specialized class artifact of a class with reified
>- members per instance
>This is especially confusing given that the duplicated fields would
>only exist
>for value types, while reference types would share the same member.
>I've spent a lot of time in Scala working to remove things where people
>"oh, you just need to spend 5 minutes learning it, and then it will be
>Duplicated statics is certainly not a 5 minute tax on every present or
>Java developer, it's probably a magnitude more.


More information about the valhalla-dev mailing list