linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: Indention - why spaces?
@ 2002-12-31 22:43 Heater, Daniel (IndSys, GEFanuc, VMIC)
  0 siblings, 0 replies; 29+ messages in thread
From: Heater, Daniel (IndSys, GEFanuc, VMIC) @ 2002-12-31 22:43 UTC (permalink / raw)
  To: 'Anthony J. Breeds-Taurima', Herman Oosthuysen; +Cc: lkml

 
> indent itself dosen't have a 'Linux standard' BUT 
> .../linux/scripts/Lindent
> is there to get things right (in terms of CodingStyle)

Thanks, I wasn't aware of that one, but had created my own version.

A couple more gallons of fuel to the flame :)

>From .../linux/scripts/Lindent:
 indent -kr -i8 -ts8 -sob -l80 -ss -bs -psl "$@"

-psl: seams to be inconsistent with much of the kernel code.
6 == half dozen IMHO.

-sob: Ackkk! I prefer to have two blank lines between functions. I think it
just
makes things easier for the eyes to parse. But in general, I'd say respect
the
authors judgement in use of blank lines.

^ permalink raw reply	[flat|nested] 29+ messages in thread
* Re: Indention - why spaces?
@ 2002-12-31 17:21 Roberto Peon
  0 siblings, 0 replies; 29+ messages in thread
From: Roberto Peon @ 2002-12-31 17:21 UTC (permalink / raw)
  To: linux-kernel, Felix Domke


Sorry to fan the flames... *sigh*

I like editors that show me tabs since I can use it as a simple ruler for which block I believe myself to be in. For example:

The >- characters show a tab. Were my tabwidth other than 2, I'd have that many more '-'s.

>-struct MetaObjectGetsMetaObjectAction: public ActionBase{
>->-~MetaObjectGetsMetaObjectAction(){}

>->-MetaObjectBase* a,*b;
>->-MetaObjectGetsMetaObjectAction(MetaObjectBase* ta, MetaObjectBase* tb){
>->->-a=ta;
>->->-b=tb;
>->-}

The '>-'s are in another color (dark grey in a black terminal) 
When I edit code that is written with only spaces I don't get this hint as to block-level.

The only way I can get this otherwise is to hack my editor (yech), or retab the source, which is evil and shouldn't be done.

I'm not proprosing any changes since I'm not an active kernel developer imho I've got no say in the matter and no right-to-say.

-Roberto Peon
robertopeon@sportvision.com


---------- Original Message ----------------------------------
From: Felix Domke <tmbinc@elitedvb.net>
Date: 	Mon, 30 Dec 2002 21:43:19 +0100

>hi,
>
>> This problem is as old as the typewriter itself.  The trouble is that 
>> a Tab character doesn't have a fixed size - some set it to 3 
>> characters wide, some to 4 some to 8, or whatever.
>>
>> The 'indent' program was written a couple of decades ago, to pretty 
>> print C code.  It has a 'GNU' standard, but I'm not aware of a 'Linux' 
>> standard.  Anyhoo, the only way to prevent indentation wars is to use 
>> spaces, not tabs and to set 'diff' to ignore white space when 
>> comparing files... 
>
>Anyhow, sorry, i really can't understand that. What could be more 
>"indention war preventing" that letting everybody use his own indention 
>width?
>
>There are two main aspects of *not* using tabs:
> - editors mess them up. but: use an *editor*. not a word processor. 
>kernel source's line endings are \n, not \r\n. some (windows) editors 
>mess them up.  and nobody cares (and that's ok that way. nobody WANTS to 
>use an editor which messes up so simple things).
>some editors don't show tabs. well. this leads to a mixup of tabs <-> 
>spaces. but if you really fear about this, just use an editor which 
>supports showing tabs. joe doesn't show spaces (by default?), but i 
>never missed that, for example.
> - aligning. well, just use spaces for aligning, tabs for indention. two 
>different things. two different characters.
>
>TAB characters simply *have* no assigned width. that's the reason for 
>them. they are not a macro for 3/4/8 spaces.
>
>not using spaces, in my eyes, just *takes* a possibility to 
>platform-independant format sourcecode on the given screensize. it gives 
>you nothing.
>
>and as they might be some pitfalls (wrong aligning etc.), you can still 
>set the tabwidth to the one of the author. in that case, you didn't win 
>anything by using tabs, but you didn't loose either.
>
>again, i was just *wondering* why everybody is using spaces, and still, 
>i can't find a good reason for that. if anybody shows me that, i'll 
>maybe start using spaces (again).
>
>felix
>
>
>
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at  http://www.tux.org/lkml/
>

^ permalink raw reply	[flat|nested] 29+ messages in thread
* Indention - why spaces?
@ 2002-12-30  2:29 Felix Domke
  2002-12-30 11:28 ` Christoph Hellwig
  0 siblings, 1 reply; 29+ messages in thread
From: Felix Domke @ 2002-12-30  2:29 UTC (permalink / raw)
  To: linux-kernel

Hi kernel hackers,

yes, i know http://www.purists.org/linux/#indent .

my question is just: what's the matter of NOT using tabs instead of 
spaces? i think there must be one, otherwise everybody would use tabs.

I know the thing about "more than 3 levels of indention *suck*" (but i'm 
not sure if i have really understand this yet in my coding style, but 
who cares..), but i like tab characters more than spaces, simply because 
it removes all the discussion about the best indention width. some 
people use ~180 character-consoles, some use 80 ones.Whats the reason of 
not giving the freedom to choose whatever he likes?

i don't want to change anything, i just like to know WHY people use 
spaces. are they somehow unportable? (i don't think so)




^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2002-12-31 22:35 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <fa.f9m4suv.e6ubgf@ifi.uio.no>
2002-12-30  3:33 ` Indention - why spaces? Russ Allbery
2002-12-30  3:43   ` Larry McVoy
2002-12-30  3:47     ` john slee
2002-12-30  4:26     ` Russ Allbery
2002-12-30 23:20     ` Mark Mielke
2002-12-30 12:28   ` Wichert Akkerman
2002-12-30 12:49     ` John Bradford
2002-12-30 12:57       ` Wichert Akkerman
2002-12-30 13:12       ` Rik van Riel
2002-12-30 13:16       ` Russell King
2002-12-30 13:17       ` Dave Jones
2002-12-30 18:53         ` Emiliano Gabrielli
2002-12-30 19:00           ` Arnaldo Carvalho de Melo
2002-12-30 19:30             ` Herman Oosthuysen
2002-12-30  9:42               ` Zac Hansen
2002-12-30 20:43               ` Felix Domke
2002-12-30 23:26                 ` Mark Mielke
2002-12-31  1:02                   ` Wichert Akkerman
2002-12-30 23:55                 ` Herman Oosthuysen
2002-12-31  2:20               ` Anthony J. Breeds-Taurima
2002-12-31  9:47                 ` Christoph Hellwig
     [not found]         ` <mailman.1041274740.23755.linux-kernel2news@redhat.com>
2002-12-31  5:28           ` Pete Zaitcev
2002-12-31  6:04             ` Larry McVoy
2002-12-30 16:12     ` Larry McVoy
2002-12-31 22:43 Heater, Daniel (IndSys, GEFanuc, VMIC)
  -- strict thread matches above, loose matches on Subject: below --
2002-12-31 17:21 Roberto Peon
2002-12-30  2:29 Felix Domke
2002-12-30 11:28 ` Christoph Hellwig
2002-12-31  8:55   ` Tomas Szepe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).