"Model 2" prototype status
Vitaly Davidovich
vitalyd at gmail.com
Thu Aug 6 17:26:41 UTC 2015
Quite frankly, these are java/jvm issues -- in .NET there's no
inconsistency such as
This is especially confusing given that the duplicated fields would only
> exist for value types, while reference types would share the same member.
My initial objection was about the comment that .NET goofed up, which I
disagree with; whether something different needs to be done for java to
maintain backcompat is a different (and likely) story.
I've spent a lot of time in Scala working to remove things where people
> said "oh, you just need to spend 5 minutes learning it, and then it will be
> fine!".
> Duplicated statics is certainly not a 5 minute tax on every present or
> future Java developer, it's probably a magnitude more.
If the system is self inconsistent (your example of duplicated fields on
value types vs ref types), then yes, that's bad. Otherwise, it bugs me
that there's some sentiment that java developers are somehow incapable of
learning anything "advanced", however you define that (I've seen this type
of view expressed many times on this list and elsewhere). I've never
seen/heard of anyone complaining about how CLR handles static fields on
generic types. There are far more involved concepts that a java developer
needs to become familiar with. If one wants to be beginner friendly, then
provide good documentation, examples, community, etc around the language
rather than somehow dumbing the language down.
On Thu, Aug 6, 2015 at 12:56 PM, Simon Ochsenreither <simon at ochsenreither.de
> wrote:
> I'm not saying that duplicating static members is without benefits,
> especially 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 and
> 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.)
>
> With duplicated members, we would put the implementation details of
> specialized 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 Generics
> - members per specialized class artifact of a class with reified Generics
> - 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
> said "oh, you just need to spend 5 minutes learning it, and then it will be
> fine!".
> Duplicated statics is certainly not a 5 minute tax on every present or
> future Java developer, it's probably a magnitude more.
>
More information about the valhalla-dev
mailing list