Quote from: OpenGeek at Jan 24, 2008, 09:16 PM
And no, this isn’t Python, but the same issues apply regarding using various editors, some that are simply inept at dealing with the problem properly.
...
Regarding the 4 bytes vs 1 byte argument, I do agree the space savings could be important for objects being delivered to the browser, but I’m not convinced that this point trumps the other issues. But I’m certainly not going to block any dialog on the subject, so feel free to convince me otherwise, or override my veto...
Because I’m a huge supporter of tabs (and because Jason said I can do so), I want to open this topic up for some debate. My most curious question is: who on the team is using an editor that doesn’t fully support tab indenting?
Perhaps to get a better idea we could compile a list and tally all of the current team’s preferred editor. I would be surprised if people on the team are using editors that don’t support tabs; but maybe I should bite my tongue because I really don’t know all the coders on the team as well as I should...
Personally, I will follow whatever standard is set in place for this project. But here’s my proposal regarding this: Use tabs for indentation only and use spaces only when aligning text/comments that span multiple lines.
Here’s an example of my proposal in action:
<?php
/**
* Used only to demonstrate when to use spaces as opposed to
* tabs when writing/indenting code.
*
* "___>" = tab character
* "...." = 4 space characters
*/
function example_function() {
___>if (true)
___>......return true;..// A comment that will span
___>else..return false;.// multiple lines
}
Coding in this manner will give each programmer their own control over how many spaces a tab should be interpreted as and also ensures that each programmer will see the code aligned the way it should be.
Give it a try in your favorite editor (replacing it with the appropriate tabs/spaces). I’ve been indenting in this manner for two years, across 3 different editors, and my code looks the same in each one.
Edit: As for compiling and tallying a list of editors our programmers use, I thought about starting a new list on
listze. However, since any registered user is able to vote and add list items, it might not be the best option. I’m open to other ideas.