Hi, I totally agree that most important is to have a consensus. And apparently the majority of the community prefer to use tabs. I asked because all the coding standards I looked at recently use spaces instead of tabs:

- Moodle http://docs.moodle.org/en/Development:Coding_style#Indentation
- Zend Framework http://framework.zend.com/manual/en/coding-standard.php-file-formatting.html#coding-standard.php-file-formatting.indentation
- PEAR http://pear.php.net/manual/en/standards.indenting.php
- Python http://www.python.org/dev/peps/pep-0008/

But after a quick search I found other important free software project that use tabs (just as an example):

- Wordpress http://codex.wordpress.org/WordPress_Coding_Standards

I have just one more doubt. The PEAR coding standard mention that they use spaces to avoid problems with tabs when performing diffs. There are some tips to use tabs and do not run into trouble with diffs? As I'm not used to use tabs I'm not even sure what kind of problem could be, if there are any.

I propose that we clarify the reasons why we use tabs on dev.tikiwiki.org. I will try to organize something during this week. Maybe creating a page for coding standard and on this page explain why we use tabs and also give some tips on how to properly configure some popular editors to use tabs. It might also be a good idea to think of ways to make it clear that we do have a coding standard (I bet that a good part of Tikiwiki developers didn't know that we have one, including myself a few days ago).

The numbers I mentioned about how much of the code use spaces and how much use tabs are not precisely (for example, as mentioned by Sylvie, they include the Zend library which is huge and use spaces for indentation) but they do show that we have a mix of both on Tikiwiki code. So we might consider again some code cleanup.


On Fri, Jun 26, 2009 at 7:45 PM, Stephane Casset <sept@logidee.com> wrote:
Le Sat, Jun 27, 2009 at 12:22:14AM +0200, Jean-Marc Libs écrivait :
> Hi,
> On Fri, Jun 26, 2009 at 11:57 PM, Sylvie Greverend<sgreverend@gmail.com> wrote:
> > On Fri, 2009-06-26 at 18:01 -0300, Rodrigo Sampaio Primo wrote:
> >> Hi Sylvie, I always had problems while using tabs because they display
> >> differently in different text editors.
> I always thought that would be an argument in favor of tabs. I like
> vertical windows side by side, so my preferred tab size is 2 spaces. A
> long time ago, I used spaces and I also spaced everything at 2 spaces.
> Some other people use horizontal windows and prefer tabs equivalent to
> 8 spaces.
> With tabs, we don't have to adapt to anyone else's preferences, we
> just have to figure out how to configure our editor of choice.
> For me, spaces were neat when I started programming alone and I never
> shared code, I liked that I could cut-paste from one xterm to the
> other and not lose the spaces. Now I work on code other people wrote,
> I know vmdiff and splitscreen, so I don't cut-paste with the mouse,
> and I really prefer tabs.
> So now, I really prefer tabs.
> If anyone is interested, the relevant line in my .vimrc is:
> :set tabstop=2

+50 for using tabs, I used to use 2 spaces for indenting, but tabs are
more flexible...

Stéphane Casset            LOGIDÉE sàrl       Se faire plaisir d'apprendre
1a, rue Pasteur        Tel : +33 388 23 69 77           casset@logidee.com
F-67540 OSTWALD        Fax : +33 388 23 69 77           http://logidee.com

Tikiwiki-devel mailing list