[Freeciv-Dev] Re: Coding Style Guidelines
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Sat, Jan 12, 2002 at 10:43:04AM +0100, Raimar Falke wrote:
> On Fri, Jan 11, 2002 at 09:29:17PM -0600, Chris Richards wrote:
> > Sub-subject: spacing and -ts0
> >
> > Since some people aren't strict K&R (re: style guide discussion), is
> > it poo-poo'd to use spacing as follows:
> >
> Indent will do
> > if (foo) {
> ^ enforce a space here
> > need_to_call (maximize (foo));
> ^ ^ will remove these spaces
> > }
> >
> > Essentially I add a space before the '('. K&R doesn't mind the space
> > after the 'if' but it changes it for the function calls.
>
> IMHO it isn't important what style we use. It is important that we use
> one style and that this style covers a lot of the problems.
I _really_ dislike spaces after the function call and before the (.
I might not commit a patch if those were all over the place.
the spaces after the ifs, etc, I personally don't put them in, but
I wouldn't really care if a submitted patch has them.
>
> > Secondly, indent it goes crazy with tabs. Personally, I think tabs
> > should be frowned upon. And 'indent' does strange things with tabs.
> > For example, I ran some cruft through indent and this is what it
> > produced:
> >
> > void bar()
> > {
> > SSSSif (foo) {
> > Tneed_to_call(maximize(foo));
> > SSSS}
> > }
> >
> > Where 'S' is space and 'T' is tab because tab is 8 spaces by default.
> > So for every 8 spaces it indents, it adds a tab filling the remainder
> > with 4 spaces if necessary.
>
> > So, I think that any invocation of indent should specify -ts0.
again, I personally will not run indent on a submitted patch. The
submitted patch should follow the rules outlined in the style guide.
Indent does some silly things (still legal, according to the style
guide) that look like crap and that the author might not have intended.
i.e. the patch author can manually make code look far better than indent
can.
but if -ts0 makes indent behave better, I'm all for it. What do other
people think?
-mike
- [Freeciv-Dev] Coding Style Guidelines, Mike Kaufman, 2002/01/11
- [Freeciv-Dev] Re: Coding Style Guidelines, Teemu Kurppa, 2002/01/11
- [Freeciv-Dev] Re: Coding Style Guidelines, Raimar Falke, 2002/01/11
- [Freeciv-Dev] Re: Coding Style Guidelines, Jason Short, 2002/01/11
- [Freeciv-Dev] Re: Coding Style Guidelines, Raimar Falke, 2002/01/11
- [Freeciv-Dev] Re: Coding Style Guidelines, Mike Kaufman, 2002/01/11
- [Freeciv-Dev] Re: Coding Style Guidelines, Raimar Falke, 2002/01/11
- [Freeciv-Dev] Re: Coding Style Guidelines, Chris Richards, 2002/01/11
- [Freeciv-Dev] Re: Coding Style Guidelines, Raimar Falke, 2002/01/12
- [Freeciv-Dev] Re: Coding Style Guidelines,
Mike Kaufman <=
- [Freeciv-Dev] Re: Coding Style Guidelines, Ross W. Wetmore, 2002/01/13
- [Freeciv-Dev] Re: Coding Style Guidelines, Tony Stuckey, 2002/01/14
- [Freeciv-Dev] Re: Coding Style Guidelines, Per I. Mathisen, 2002/01/14
- [Freeciv-Dev] Re: Coding Style Guidelines, Erik Sigra, 2002/01/23
- [Freeciv-Dev] Re: Coding Style Guidelines, Reinier Post, 2002/01/12
[Freeciv-Dev] Re: Coding Style Guidelines, Gregory Berkolaiko, 2002/01/11
|
|