[Biojava-dev] Feature Templates

Keith James kdj at sanger.ac.uk
Mon Sep 8 06:29:40 EDT 2003


>>>>> "Matthew" == Matthew Pocock <matthew_pocock at yahoo.co.uk> writes:

[...]

    Matthew> The one thing that mucks things up is mixing in tabs with
    Matthew> spaces. I know things like emacs like to put them in, but
    Matthew> they cause the most formatting hastle of all.

Only if you tell it to use tabs, though (mine uses spaces).

    Matthew> I tend to use 2 char indent, spaces after casts & commas,
    Matthew> [] after type and before variable, one declaration per
    Matthew> line, things that get broken across lines get lined up on
    Matthew> +1 or +2 indents or alignmed with '(' - depending, and
    Matthew> attempt to wrap at 80 char.  In truth, I hit the 'format
    Matthew> this code' button in my IDE when files look too uglee,
    Matthew> and accept that (but then I've had a bit of a discussion
    Matthew> with my IDE over what is and isn't acceptable).

    Matthew> If coding style is an issue, could we get all checkins
    Matthew> pretified by cvs prior to commit? Not sure if CVS can do
    Matthew> this kind of thing.

I've been doing a survey of available Java formatters because I'm
setting up a new codebase here, from scratch. Useful features would be

1. Platform independent
2. Standalone version available (& maybe an Ant task)
3. IDE plugin versions available
4. Extendable/fixable (preferably open source)

None that I can find fit all of these criteria. Those that can be
re-distributed:

Jalopy: 1, 2, 3, 4 (but a fairly buggy beta, no longer supported by
                    the developer - I wouldn't use it myself)

astyle: 2, 4 (limited features, in C++, but the jedit plugin is Java
              so it may go cross-platform without requiring a compiler)

Anyone know of others? There are several commercial or otherwise
non-distributable packages e.g. jindent, jacobe, jpretty, trita.

Keith

-- 

- Keith James <kdj at sanger.ac.uk> Microarray Facility, Team 65 -
- The Wellcome Trust Sanger Institute, Hinxton, Cambridge, UK -


More information about the biojava-dev mailing list