wow, only 3 eclipse references.
why is auto-formatting (a next-next-generation editor?) such a big deal for the unwashed jeffs and followers?
I now know what Geisterfahrer means.
I can see a new set of adverts - maybe with Vin Diesel and Keifer Sutherland:
Iām a TAB
.
.
.
Iām a space
captcha should probably change once or twice⦠it seems the Chinese spammers have discovered the secret power of orangeā¦
But the best way to train them not to do it, is to ignore their bad behavior.
I think Jeff ought to include more a second version of each post that has mostly pictures and very few words so some of the readers can keep up.
I wonder if the spammers have figured out the secret of the capcha, of if theyāve just got some human typing it in each time.
Those who say it doesnāt matter as long as itās consistent are dead on. I have my opinions, of course, but the fact is that my eyes will adjust to whatever the coding standard ends up being. That saidā¦
Iām really surprised by how many tab supporters there are here. I donāt think Iāve ever run across another programmer who prefers tabs over spaces. I guess I can sort of see the appeal, but thereās not a lot of consistency between editors on how tabs are implemented and I think youāre just asking for trouble. With spaces, you always know how things are going to turn out. A space is a space. A tab isā¦well, whatever your editor decides it is.
Plus, in my experience, even if tabs are mandated youāll still end up with spaces in your files. Why? The tab key is configurable in most decent editors, but the space key never is because you wouldnāt want it to be. You can make the tab key give you spaces, but you canāt make the space bar give you tabs, so stray spaces will always find their way in. (Unless maybe thereās an option to convert x spaces to tabs? This feature probably exists in some editors.)
Gah, just look at the amount of comments in this blog post⦠Color of the bikeshed?
āWhat is the reason for wanting to use spaces? Can anyone explain?ā
- You canāt get by without spaces.
- a mixture of tabs and spaces will inevitably lead to misaligned, hard-to-read code.
- you can get by without tabs: in fact, everything they do is really much better done by other means.
If you want to configurably reformat code to your personal preferences, it is much easier to set up one configurable reformating tool than the dozen or so different tools that will end up displaying code at some point. And that tool will handle not just indent level, but bracket placement, line length, and so on.
Repository code should be space-only, simply because it canāt be tab-only.
That said, only a moron would use tabs to format their code.
tut tut!
I work as a sub contractor and thus with several different clients. Each client has there own way of formatting its code, you can imagine my problemsā¦
thanks for all the code!!!
- a mixture of tabs and spaces will inevitably lead to misaligned, hard-to-read code.
If tabs are used for indentation and spaces for non-indent alignment, that isnāt true. But what youāre really saying is that using tabs isnāt viable just because itās a style decision. In which case, choosing a certain number of spaces for indent carries the exact same caveat.
The people arguing for tabs make explicit the benefit of editor display configuration. Personally, Iāve seen no text editor that can handle syntax highlighting and not something as simple as tab widths or space substitutions.
The people arguing for spaces make implicit the obstacle of a lack of editor display configuration. They should stop arguing about the benefits of spaces, which are none on the terms theyāre talking, and discuss what tools theyāre actually using and why.
The only thing more tiring than people talking over each other wrt tabs v. spaces is dealing with space-indented code.
The chinese spammer makes more sense than Atwood.
The really frustrating thing is when the IDE starts reformatting your code. Especially when it gets it wrong. I donāt know how many times I have had an IDE try to find tabs and starts creating weird tabs at 3 and 5 spaces. And itās actually creating spaces! Argh. Just put it under the block above! Canāt you see the code? Why is your smart tabbing so stupid! Stop trying to reformat my code!
I get frustrated just thinking about it.
Stupid smart formatting
A small experiment to see which is better.
Spaces:
if (!Array.prototype.reduce) {
Array.prototype.reduce = function(func, initial) {
var current = initial;
for (var i = 0; i this.length; i++) {
current = func(current, this[i]);
}
return current;
};
}
Tabs:
if (!Array.prototype.reduce) {
Array.prototype.reduce = function(func, initial) {
var current = initial;
for (var i = 0; i this.length; i++) {
current = func(current, this[i]);
}
return current;
};
}
It seems, that there is absolutely no difference
Hey AftWood Every rule of KR nazi code writing guideline is there to make You Keep It Simple stupid - Greatest Man In The World (me of course)
Iāve been guilty in the past of ācleaning upā otherās code, but mostly only so when Iām amending it/updating it I can actually tell what the hell is going on, our production programmers use vi in Linux to write code and whitespace use along with everything else is extremely inconsistent.
@John W: Can I work for you?
orange you glad I didnāt say banana?