From: Jean-Marc L. <jea...@gm...> - 2009-06-26 22:22:22
|
Hi, On Fri, Jun 26, 2009 at 11:57 PM, Sylvie Greverend<sgr...@gm...> 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 >>I use Emacs and for example it >> does not display properly files that were indented with tabs in >> Eclipse. But this might be a problem of some configuration that I >> don't know and not a problem with using tabs. > My .emacs: > (setq default-tab-width 4) > (setq tab-width 4) > (setq indent-tabs-mode t) > But I suppose it is your eclipse that does not provide tabs. I would be very surprised if there are programmers' editors which don't let you choose the size of your tabs (no, notepad and wordpad are not suitable for serious programming :-) ). >> Probably this has been discussed before, if so could you point me to >> that discussion? I'm sure that my concerns were discussed before and >> then you don't have to explain all again. > I can not find out on the mailing list - but I think it was in summer > 2004 I think it has also been discussed in Strasbourg in summer 2008, possibly even on IRC at the same time. But this only led to a wiki page saying to use tabs, not a summary of the discussion. >> I think it is a good idea to add some information on >> dev.tikiwiki.org/DevTips explaining why we use tabs instead of spaces >> as this is an exception to the Zend Framework coding standards. I'm >> avaliable to help on this. > .... Tikiwiki did not know about Zend in 2004... Any doc is welcome >> >> If the two grep lines below are not wrong we have 3/5 of Tiki code >> using tabs and 2/5 using four spaces: >> $ grep -r -o -P '\t' * | wc -l >> 2963265 >> $ grep -r -o ' ' * | wc -l >> 1956585 I'd be more interested in how many correctly indented files use only spaces vs how many correctly indented files use only tabs. Files which mix both are a mess for everybody not lucky enough to have the same tabsize as the previous coder. They need to be redone anyway :-( Jyhem >> Thanks, Rodrigo >> >> On Thu, Jun 25, 2009 at 9:39 AM, Desilets, Alain >> <Ala...@nr...> wrote: >> Hum... I've been using spaces since the beginning. Sorry about >> that. >> >> I will start using Tabs instead. >> >> Alain >> >> >> >> -----Original Message----- >> From: Sylvie Greverend [mailto:sgr...@gm...] >> Sent: Wednesday, June 24, 2009 5:58 PM >> To: Tikiwiki developers >> Subject: Re: [Tikiwiki-devel] TikiWiki coding standards: >> spaces or tabs >> >> Tab can be adjust to any numbers of characters - it is more >> flexible. >> You can put 4 or 2 characters or whatever. >> '4 characters' has no semantic. tab has a semantic. >> +100 to prohibit space for indentation. >> (We clean already the code - hope we will not have to clean >> again) My 2 >> cents sylvie >> >> On Wed, 2009-06-24 at 18:04 -0300, Rodrigo Sampaio Primo >> wrote: >> > Hi, I was glad to see in the DevTips page that now there is >> a coding >> > standard for Tiki (last time I checked was a few years ago). >> > >> > One think that I didn't understood is why there is a >> exception to use >> > tabs instead of four spaces for indentation. Do you know if >> there has >> > been some discussion about this? I wasn't able to find any >> discussion >> > on this subject on devel list. >> > >> > AFAIK, it is better to use spaces instead of tabs (different >> editors >> > will display code indented with tabs differently and so on). >> So I >> > would like to know if there is a good reason for using tabs >> instead of >> >> > spaces? >> > >> > Thanks, Rodrigo. >> > >> ---------------------------------------------------------------------- >> > -------- _______________________________________________ >> > Tikiwiki-devel mailing list >> > Tik...@li... >> > https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel >> >> >> ------------------------------------------------------------------------ >> ------ >> _______________________________________________ >> Tikiwiki-devel mailing list >> Tik...@li... >> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Tikiwiki-devel mailing list >> Tik...@li... >> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel >> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Tikiwiki-devel mailing list >> Tik...@li... >> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel > > > ------------------------------------------------------------------------------ > _______________________________________________ > Tikiwiki-devel mailing list > Tik...@li... > https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel > |