From: Brian H. <bh...@sp...> - 2003-10-05 17:57:03
|
On Sun, 5 Oct 2003, Nicolas Cannasse wrote: > > since the INRIA-team has decided to avoid tabulators in sources, and > > since I also think that this is good style, I'd propose that each tab > > be replaced by (two) ordinary spaces. Any comments? > > We already have been discussed about that : > Tabs are entirely my fault since there is no auto-tab on my windows editor > (no flames here please). We concluded that the "working" sources can > contains tabs but that once finalized we will switch from tabs to spaces ( 2 > ou 4 , matter of taste ). Looks like this second point have been forgot > before the release :-) I vote for 4. :-) Seriously, having worked with it for a while, I've found I don't mind tabulated source. So long as it's tabs first, then spaces. Yeah, I know that if you search the past emails, I was opposed to this before. One important point I will make: windows and unix seem to have a different idea of what a tab means. On windows, a line " \tx" causes the x to be in column 9 (assuming a tabstop of 8), while on unix the x is in column 8. In windows, a tab moves you tabstop columns to the right, while in unix a tab moves you to the next column which is an integer multiple of the tabstop. Note that tabs followed by spaces is always correct, so "\t x" always puts the x in column 9 (assuming a tabstop of 8) on both windows and unix. It's spaces followed by tabs which create a mess. I don't know if people noticed this or not, but I used this in my code when I'm lining code up with specific parts of the line above. For instance, if I have a multi-line let statement, it'll be entered like: \t\tlet x = some stuff \t\t some more stuff \t\tin ... This way, no matter what you set your tabstop to, the some more stuff on the second line is lined up correctly with the some stuff on the first line. On unix and on windows. The advantage of tabs over spaces is that it allows us to avoid a flamewar over *how many* spaces to indent. This way, just set your tabstops to whatever you want. You can set your tabstops to 2, I can set them to 4, we're both happy, all the code looks correct, and we're not constantly reindenting each other's code. Brian |