Style question : sort members ?
Tom Zeller
tzeller at dragonacea.biz
Thu Feb 13 18:50:20 EST 2014
>> I like to sort source code in Eclipse via :
>>
>> Source -> Sort Members... -> Sort All Members
>
> Takes all kinds, I suppose. I'm probably with Scott on this one: the order I want to see things appear in as I scroll through the file depends on their purposes and relationships, not the alphabet. When looking at the whole file, in other words, the ordering represents some kind of narrative.
Maybe take a look at n.s.i.service.ReloadableSpringService in
idp-core, and suggest where the beanName field, setBeanName() and
doInitialize() methods, which were added to implement BeanNameAware,
should be moved to ? I just tacked the methods on at the end,
semantically meaning "added last". I put the beanName field next to
parentContext, because they are related to the *Aware interfaces. I
guess doInitialize() should be moved above doDestroy and after
doReload().
>> Should that be a coding convention ? Opinions ?
>
> I do not think that we should adopt this as a coding convention.
>
> If you feel that alphabetical ordering helps you to navigate large files (and I sometimes find it helps me, particularly with code I'm not familiar with), you might try using the Outline pane in Eclipse and poking the "Sort" button there. This gives *exactly* the "Alphabetical, grouped by fields, constructors, methods" view you prefer, without imposing it within the file.
I never pushed that button before, thx :-)
More information about the dev
mailing list