tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Todd <jwt...@pacbell.net>
Subject Re: example (spaces vs. tabs)
Date Thu, 06 Jan 2000 10:24:50 GMT

coming to agreement to "tab or not to tab" is one thing but i think
if folks share ideas as to how to achieve this for various dev environments
will help folks to come to agreement ... once they see how easy it
is. on the other hand, i feel that considering wiring in a "code
cleaner/beautifier"
into the process in one form or another might be attractive. i realize that
this could muck up the diffs but i wonder if there is a way to commit
beautified changes without emitting diff emails ... hmmmm.

regarding curlies, i tend to use 'em all the time even for one liners
as occassionally the need arises to come along and add another
line or two ... and the curlies are already in place. this is just a habit
i've formed and happen to like.

regarding using // to comment out blocks ... no way ... silly in my book,
unless your editor does it for you automatically. even then i prefer using
block comments ... even for a couple of lines.

hope this helps,

- james

Conor MacNeill wrote:

> I don't think formatting tools or editor configurations is the issue here.
> The real problem is that the use of tabs or spaces is left unspecified. If
> we were to agree that only spaces were to be used, I'm confident the people
> who submit patches could configure their editors appropriately.
>
> If people submitting patches were to use something like JIndent now, the
> relevant patch content would be lost in a maze of tab to space diffs. Maybe
> use of JIndent or some such tool could be used by committers after
> application of patches to gradually move us to a system of just using
> spaces.
>
> Perhaps to try and close this issue, I suggest the committers vote on
> whether to tighten the coding conventions to mandate use of spaces and
> prohibit tabs. Is that the appropriate process?
>
> Interestingly while there is a lot of heat about the tab versus space issue,
> there are stacks of other "violations" of the code conventions. In some
> cases the Sun conventions are fairly out of step with what I believe to be
> common practice such as this statement
>
>    "The // comment delimiter can comment out a complete
>     line or only a partial line. It shouldnÂ’t be used on
>     consecutive multiple lines for text comments"
>
> Does anyone subscribe to this view? Another commonly violated convention is
>
>    "Note: if statements always use braces {}. Avoid the
>     following error-prone form:
>
>      if ( condition) //AVOID! THIS OMITS THE BRACES {}!
>         statement;"
>
> The use of "always" is a pretty strong statement. I'm not trying to be
> pedantic; If there is to be a coding convention, then we should adhere to it
> :-) If it isn't right, then we should change it, augment it, tighten it, fix
> it, whatever. Perhaps a document with clarifications or exceptions to the
> Sun Code Conventions would be appropriate.
>
> Cheers
> Conor
>
> --
> Conor MacNeill
> conor@m64.com
> M64 Pty Limited
>
> > -----Original Message-----
> > From: David Chisholm [mailto:David_Chisholm@i2.com]
> > Sent: Wednesday, 5 January 2000 1:06
> > To: tomcat-dev@jakarta.apache.org
> > Subject: Re: example (spaces vs. tabs)
> >
> > Have you tried JIndent (http://home.wtal.de/software-solutions/jindent/).
> > It's very good at fixing these kinds of problems.  We're adding it as an
> > automatic step of our configuration management system.  Perhaps the same
> > could be done for this system.
> > David
> >
> > ----- Original Message -----
> > From: James Todd <jwtodd@pacbell.net>
> > To: <tomcat-dev@jakarta.apache.org>
> > Sent: Tuesday, January 04, 2000 1:13 AM
> > Subject: Re: example (spaces vs. tabs)
> >
> > >
> > > agreed. perhaps some folks could share some emacs, vi, etc
> > > config settings and/or hacks as to how best to use spaces over
> > > tabs ... vs 4 or 8 spacebar stabs :)
> > >
> > > <repeat>
> > >     i used to like ?JBeautifier? for lots of features including
> > >     a "tab to space conversion" which is a default config
> > >     option if i recall correctly.
> > > </repeat>
> > >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message