[Grace-core] Fwd: [SLURP] interesting (non-)class

James Noble kjx at ecs.vuw.ac.nz
Mon Mar 28 22:43:10 PDT 2011


Interesting comment for Alex Buckley about initialisation & types more  
generally...

J

Sent from my iPhone

Begin forwarded message:

> From: Alex Buckley <abuckley at venger.org>
> Date: 29 March 2011 18:38:26 NZDT
> To: Summers Alexander John <alexander.summers at inf.ethz.ch>
> Cc: "pmgroup at lists.inf.ethz.ch" <pmgroup at lists.inf.ethz.ch>,  
> "Haoxuan \(Max\) Cai" <max at doc.ic.ac.uk>, "slurp at doc.ic.ac.uk" <slurp at doc.ic.ac.uk 
> >
> Subject: Re: [SLURP] interesting (non-)class
>

> On 3/28/2011 8:09 AM, Summers Alexander John wrote:
>> However, this still seems to me to be overkill, because as far as I
>> can see (a) nothing actually unsound can happen if one reads from
>> "this" before its constructors have executed,
>
> Yes, but as Max alluded to, why should some expressions be allowed  
> to observe the default state of instance variables while others  
> cannot? Isn't that a recipe for confusion?
>
>> and (b) it seems to be easy to see either by hand or by some simple
>> analysis whether or not "this" is potentially dereferenced/passed to
>> anything other than a "this" call (although it does require checking
>> all constructors in a class together, to be fully accurate).
>
> Nothing in Java is easy. It only looks that way.
>
> Also, consider that until generics came along, there was no such  
> thing as a warning in the Java language. There were only compile- 
> time errors. Avoiding compiler-specific warnings is good because it  
> promotes portability and more generally the idea that the language  
> is always right. This matters when there is more than one Java  
> compiler.
>
> Beyond this bias against warnings, an analysis that is important  
> enough to justify _some_ message but not strong enough to justify a  
> proper error is inevitably going to lead to programmer confusion.  
> "Go check this by hand" is not a particularly helpful message. This  
> comes to the fore with the non-null type systems proposed for  
> inclusion in Java over the years.
>
> Alex
>
> _______________________________________________
> SLURP mailing list
> SLURP at imperial.ac.uk
> https://mailman.ic.ac.uk/mailman/listinfo/slurp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailhost.cecs.pdx.edu/mailman/private/grace-core/attachments/20110329/fc78600f/attachment.html>


More information about the Grace-core mailing list