[GRASS-dev] Tabs and spaces in C code

Huidae Cho grass4u at gmail.com
Sun Sep 7 05:57:37 PDT 2014


I want to add one more perspective to this discussion. In terms of
formatting, mixing tabs and spaces looks fine, but when I change
indentation levels, my editor (vim) doesn't like mixed tabs and spaces. For
example, I want to change the indentation level from 4 (two tabs) to 3 (one
tab + 4 spaces), vim doesn't like it and hitting backspace deletes only one
space. I found some settings to deal with it automagically, but entering
after an opening brace does not indent properly yet and I have to manually
deindent one level. I couldn't find any good trick to solve this issue if
any exists.

I think, if we want to mix tabs and spaces, we need good support from our
editors, otherwise, it can be very annoying to mix tabs and spaces manually.

Huidae


On Fri, Aug 22, 2014 at 7:16 AM, Glynn Clements <glynn at gclements.plus.com>
wrote:

>
> Vaclav Petras wrote:
>
> > > The "rules" are that indentation in multiples of 4 columns, and we
> > > don't care whether that indentation is acheived through spaces or
> > > tabs.
> >
> > So, since we are providing a script and standard for indentation, let's
> use
> > only spaces* in this script (rather then enforcing mixing of tabs and
> > spaces when there is no reason for it).
>
> Some might consider the reduction in file size to be a reason for
> using tabs. I have no opinion either way.
>
> --
> Glynn Clements <glynn at gclements.plus.com>
> _______________________________________________
> grass-dev mailing list
> grass-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20140907/965fc35a/attachment.html>


More information about the grass-dev mailing list