[Grace-core] Comment proposal

Andrew P. Black black at cs.pdx.edu
Sat Feb 7 21:36:22 PST 2015


A mix of comments on previous comments about comments …

Can we please move this discussion to the wiki.  At least there one can comment about the comments in place!
I don’t think that the choice of comment symbol makes any difference to the users’s expectations.  Of course, I have absolutely no evidence for this.
In contrast, since our only kind of comment is from // to end of line, it seems obvious that such comments apply to the code at the start of that line, rather than to the code on the next line.  This tells me that we should prefer Python-style method comments(immediately after rhe header) over JavaDoc style method comments (on lines before the method header).
Michael wrote: "Possibly a comment without other attachment at the top of a block can be attached to the block …  That is [a] case that's hard to handle otherwise.”  I think that’s correct (it would be weird to have such a comment at the end of the block), and it’s the reason for the existing rule that says that a comment following a blank line is attached to the largest following unit.
Rules like "comments are permitted only where semicolons are permitted - and act like semicolons” are simple only to those who know about semicolons.  We have carefully designed Grace so that novice users don't have to know about semicolons.
James’ example
> self compareTo (  other ) 
>           ifSmaller { -1 }           // if I'm smaller, return -1 
>           ifEqual    { 0 }             // if I'm equal, return zero
>           ifLarger   { 1 }             // I'm biggest!! YAY! 
can be dealt with as follows:
> self compareTo (  other )  ifSmaller { -1       // if I'm smaller, return -1 
>     }    ifEqual    { 0             // if I'm equal, return zero
>     }    ifLarger   { 1              // I'm biggest!! YAY! 
>     }
but I have to say that I don’t like that very much.  We should be careful of designing a general rule around a specific example — anyone remember Zahn’s construct?   Even the most misguided language constructs have a few examples that meme them look good.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailhost.cecs.pdx.edu/pipermail/grace-core/attachments/20150207/f042903f/attachment.html>


More information about the Grace-core mailing list