Death to the Space Infidels!

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

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?ā€™

  1. You canā€™t get by without spaces.
  2. a mixture of tabs and spaces will inevitably lead to misaligned, hard-to-read code.
  3. 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! :slight_smile:

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

  1. 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 :wink:

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 :slight_smile:

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?