Adding support section/segment separating comments

Behrang Saeedzadeh behrangsa at gmail.com
Mon Dec 17 19:10:38 PST 2012


Hi guys,

Thanks for the replies. I was more looking for something like Eiffel's
feature blocks I guess (
http://en.wikipedia.org/wiki/Eiffel_(programming_language)#Lexical_and_syntax_properties).
Even though I can live without them, but I gotta admit that I like them...

Cheers,
Behrang Saeedzadeh
http://www.behrang.org



On Fri, Dec 14, 2012 at 2:42 AM, Jonathan Gibbons <
jonathan.gibbons at oracle.com> wrote:

> Also note that some IDEs, like NetBeans, already provide the feature you
> are looking for, via "editor-fold" comments.
>
> -- Jon
>
>
>
> On 12/12/2012 11:55 PM, Remi Forax wrote:
>
>> Hi Behrang,
>> Jon Gibbons has recenly pushed a new API that allow to extract javadoc
>> comment easily,
>> so I think with this API you should be able to write your own Doclet to
>> verify that the right section contains the right information.
>>
>> I'm not a big fan of this way to segment a class because developers tend
>> to try to fill section like properties with fields that should not be
>> publicly exposed or worst with code never used and never tested.
>>
>> Anyway, it's note something that should go in the jdk but more a policy
>> that can be enforced with tools at company level.
>>
>> cheers,
>> Rémi
>>
>> On 12/13/2012 01:44 AM, Behrang Saeedzadeh wrote:
>>
>>> I remember I had seen in the past in another language, but the point is
>>> giving users some pointers about what methods in a section are doing in
>>> general. For example:
>>>
>>> public class Foo {
>>>
>>> // @section properties
>>>
>>> public int getBar() { ... }
>>> public void setBar(int bar) { ... }
>>>
>>> // @section event handling
>>>
>>> public void addActionListener(...) { ... }
>>>
>>> // @section rendering
>>>
>>> public void draw(Graphics g) { ... }
>>> }
>>>
>>> This can motivate new users to add methods to the right section in the
>>> code
>>> to keep it consistent over time.
>>>
>>> Also IDEs can use this information to categories methods based on the
>>> section they belong to (or they purpose).
>>>
>>> Cheers,
>>> Behrang Saeedzadeh
>>> http://www.behrang.org
>>>
>>
>>
>


More information about the jdk8-dev mailing list