[JSR308] Can we agree on our goals?

David Wagner daw at cs.berkeley.edu
Fri Feb 2 22:54:06 EST 2007


Hani Suleiman  wrote:
>On Feb 2, 2007, at 9:43 PM, Trevor Harmon wrote:
>> @LoopMax(10)
>> while (i < j)
>> {
>>  ...
>> }
>>
>> That doesn't seem awkward at all.
>
>Sure it does. It's a redundant new syntax that doesn't achieve  
>anything, and attacks a problem no developers are currently having  
>(no matter what background they're from or their level of ability,  
>I'd be surprised if anyone found basic looping constructs tricky).  

Is it possible you've misunderstood the purpose of such an annotation?
As others have already explained, there are tools out there that would
benefit from having this kind of annotation.  Programmers would benefit
from those tools.  For instance: worst-case execution time (WCET) tools;
JML; ESC/Java2.  The purpose of annotations on loops is not necessarily
to communicate information about the loop to other humans; it may be
document loop invariants and communicate them to the tool, which may
then use them to check properties of the code and provide feedback that
is useful to the programmer.



More information about the JSR308 mailing list