2 ms·
I think it keeps going back to "preserving type invariants". Turning an object into a value can have surprising constraints on the integrity of the type. These
by DarkNova6 2mo ago
I think it keeps going back to "preserving type invariants". Turning an object into a value can have surprising constraints on the integrity of the type. These include: forced empty constructor (for bulk initialiation in arrays), violation of cross-field invariance (think of a Range-type where "end" value is suddenly smaller than the "start" due to a data race), etc.
Java always had a focus on enabling library authors over empowering call-site users. And I think approach has proven its dividend.