[Tinyos-devel] consistency in line terminators

David Moss dmm at rincon.com
Mon Jun 9 10:56:50 PDT 2008


"Many early programs used tab characters for indentation, for simplicity and
to save on source file size. Unix editors generally view tabs as equivalent
to eight characters, while Macintosh environments would set them to four,
creating confusion when code was transferred back and forth. Modern
programming editors are now often able to set arbitrary indentation sizes,
and will insert the appropriate combination of spaces and tabs."

http://en.wikipedia.org/wiki/Indent_style

Eclipse, among other editors, can replace every tab keystroke with the
appropriate number of spaces. Incidentally, I've found it doesn't do well
displaying tabs inserted by an editor like emacs.
 
Tabs vs. spaces is certainly a religious war.  I find myself in the spacebar
camp.

-David





-----Original Message-----
From: tinyos-devel-bounces at millennium.berkeley.edu
[mailto:tinyos-devel-bounces at millennium.berkeley.edu] On Behalf Of Razvan
Musaloiu-E.
Sent: Monday, June 09, 2008 10:27 AM
To: David Gay
Cc: TinyOS Development
Subject: Re: [Tinyos-devel] consistency in line terminators

Hi!

On Mon, 9 Jun 2008, David Gay wrote:

> On Mon, Jun 9, 2008 at 3:32 AM, Aurélien Francillon
> <aurelien.francillon at inrialpes.fr> wrote:
>> Le Monday 02 June 2008 04:19:58 Razvan Musaloiu-E., vous avez écrit :
>>> Hi!
>>>
>>> The tinyos-2.x tree contains a minority (about one hundred) of files
using
>>> the Windows CRLF line terminators while the majority (about 2 thousands)
>>> follows the Unix format of using only LF. In preparation of the new
>>> release is it ok with everyone to normalize everything to LF? If there
is
>>> no complain I volunteer to do it.
>>>
>>
>> Hi, that's a good idea,
>> going forward :
>> - what about defining at the same time if the tab are allowed/recommended
?
>> Many files are mixing tabs and spaces for indentation, if your editor
uses a
>> different setting than the writer's then code it's harder to read ...
Using
>> only spaces makes the code appear similar on any editor so that's my
perfered
>> solution ;)
>> - the spaces at end of line could be avoided too...
>>
>> I think adding those recommendations  to TEP3  would be nice.
>
> Tabs are every 8 spaces. Anything else is broken (seriously) - if your
> editor allows you to change this, don't!

There are quite a big number of files that request tabs of different 
size from 8:
 	$ grep -r 'tab:4' tinyos-2.x | wc -l
 	239
 	$ grep -r 'tab:2' tinyos-2.x | wc -l
 	47

--
Razvan ME





More information about the Tinyos-devel mailing list