Am Mittwoch, den 08.02.2006, 18:14 -0500 schrieb Miguel:
> > Am Mittwoch, den 08.02.2006, 15:43 -0500 schrieb Miguel:
> >> For software development projects it is important to maintain a
> >> consistent
> >> coding style.
> >
> > Short question: What made the decision to use spaces instead of tabs for
> > indentation? Tabs allow the user to choose how many spaces are used for
> > a tab-step. Using only spaces encreases the file-size and forces the
> > user to use the chosen tab-step.
> >By default, tab stops are at 8 chars.
> 
> Many text editors will allow you to change the tab stops, but that only
> helps you within the context of the text editor.
> 
> It does not help when you are outside the text editor.

Why would you need such a help outside of an editor? IMHO you don't need
it.

> When you go to print code, the formatter will set tabs to 8 chars. The
> formatter probably has another option to change the tabs, but every
> formatter is different and has different options. You will not remember to
> set the option until you have printed some pages.

But where is the problem? I see, what is maybe your argument. But if you
set the line-length to 80(-100) chars, there is no problem with that
even if you print the code and don't know the formatter.

> Some people will leave tab stops at 8. So, when something gets indented 4
> levels they will put in a tab. Or, perhaps to take big steps when
> indenting parameters to a function. This causes even more confusion.
> 
> I like to grep for things from the command line. Look through all of the
> source code for instances of the method foo().
> 
>   find src -name \*.java | xargs grep foo
> 
> When the leading tabs get expanded to 8 chars then you cannot read
> anything because things get wrapped to the next line.

But not words. A function foobar() is not wrapped to foo\nbar(). I work
with tabs for a while and I have never seen a problem with grepping
stuff from files and I also make heavy use of the command line and also
grep. Maybe I misunderstand you.

> Best thing is to simply say 'no tabs' in the files.

This is a statement I really can't understand nor support. Tabs are
AFAIK recommended.

> That does not mean that you should not use the Tab key within the context
> of the text editor. Most text editors can be configured to allow you to
> use the tab key, but fill with spaces.

My experiences are: spaces are worse than tabs. But of course, there are
just my experiences and not always related to programming code.

> Expanded source file size because of space expansion is not an issue.

I did not speak about disk-space. Traffic is not for free so a reduced
source/archive size is something I would think about.

Regards, Daniel



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to