> 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.

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.

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.

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

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.

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


Miguel



-------------------------------------------------------
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&kid3432&bid#0486&dat1642
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to