tags:

views:

37

answers:

3

All of the SVN shops I've worked in have a strict rule - replace all tabs with spaces, to avoid whitespace conflicts and variations of tabs in different editors.

Is this a very common standard? Does it really make a huge difference, and is it worth the trouble to push this standard to a group of developers new to SVN?

A: 

I'd say it's good to have some common indentation/whitespace standard, whether it's indentation by tabs, or by 4, 8 or whatever spaces. Linux kernel apparently uses tabs that should by 8 charactes wide, Python Style Guide prescribes 4 spaces per indentation level.

What coding style you choose matters on your taste. You might want to choose something similar to dominant style in environment you're using, but having it same across whole project makes easier for people to switch between various parts. (But it can make sense if you mix kernel-styled C and Python :-)

che
This is a Java/HTML repository, so tabs shouldn't have an effect on compilation.
Eric the Red
+1  A: 

Unless you have a strict rule concerning spaces (and/or tabs), you should use tools that will ignore spaces when doing diff/compare/merge.

Max
Is that an option with SVN?
Eric the Red
Yes it is an option in SVN
Daok
Unless you're using python.
Seth
A: 

Tabs vs spaces is a hot debate, but ultimately you should standardize on one or the other (mixing tabs and spaces just leads to a mess). Whether you choose tabs or spaces, you should also standardize the width (e.g. 4 spaces, 8 spaces, etc).

Personally, I use tabs because I think they're easier to work with. And I make tabs equivalent to the width of 4 spaces in all editors.

Brian