Gabriel Roldan ha scritto:
> Hi guys,
>
> It is a long time since I'm noticing an increasing loose of care on
> applying the code formatting we're supposed to. Not to mention tabs
> instead of spaces for indentation, lack of (c) headers, and even small
> but bothering breaks of the code conventions, like lack of braces in if
> statements. And also unused imports..
Agreed, that's annoying (quite a bit of the tabs are my fault, when
I switched to Linux I forgot to setup again the GeoTools code convention).
As for lack of braces, can you confirm that's part of the Sun Java
coding convention? I really hate to add extra braces if not necessary,
to me:
if(xxx)
// one liner
reads much better than
if(xxx) {
// one liner
}
Our Eclipse formatter does not turn the first form into the second,
so I guess it is actually not part of the convention (either that
or the template is incomplete)
One thing that is annoying me instead is adding spaces in function
calls, something like, f( a, b ) instead of f(a,b).
I don't know if the coding convention covers it, for sure the
Ecilpse formatter turns the first form into the latter.
> Question is, is this deliberate? I bet not and would like to encourage
> all developers to systematically apply the formatting and follow
> conventions as described in
> <http://geoserver.org/display/GEOSDOC/1+Code+Conventions>.
>
> As we all use eclipse and the formatter is there please just try to get
> used to press CTRL+ALT+F for formatting and CTRL+ALT+O for imports clean
> up... please?
Hmmm... I always clean imports, but never user CTRL-ALT-F because it
mixes together real changes with formatting ones.
If a file is really screwed up, I'd suggest to format it in both
branches (formatting just one is murder, makes porting patches
a nightmare) and make the commit a pure formatting one (no other changes).
Ideally we could mass reformat the code in a moment where there
is just one active branch, but in practice that never happens
(with RC1 we'll be cutting the 2.0.x branch, or at least
we should, and the 1.7.x branch is still active)
Cheers
Andrea
--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel