tag:blogger.com,1999:blog-3283609923804350642.post1571007095485970251..comments2023-06-05T23:03:15.094-07:00Comments on Tor Norbye's Blog: Code Advice #3: No Tabs! Ever!Tor Norbyehttp://www.blogger.com/profile/00746799716822637466noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-3283609923804350642.post-30262736517152485852006-08-12T17:54:16.000-07:002006-08-12T17:54:16.000-07:00Well, honestly, mixing spaces and tabs is wrong, b...Well, honestly, mixing spaces and tabs is wrong, but that's because spaces force your idea of indentation on everyone else.<br>Tabs are indentation levels (in block-structured languages such as all C dialects); spaces aren't.<br>When I want to view a file with indentationlevel=2, I can do that. Other people (or myself when editing C) will sometimes set the indentation level to 8. Fine. Tabs will be displayed wider. But that's only an editor option.<br>While tabs will automatically respect the user's tab width setting, spaces are rigid and will always be the same, so you're only telling other people (with other tab width preferences), that *your* indentation is the best, which is honestly kindof arrogant in a collaborative environment (i.e. programming team).<br>Ulrich Hobelmannnoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-79158185410623154612006-07-12T18:01:41.000-07:002006-07-12T18:01:41.000-07:00Hi Tor,- the fact that we have been working with s...Hi Tor,<br>- the fact that we have been working with spaces to do lay out: that is really ugly. So I vote in favor of tabs. The issue that you address of editors not in a right way supporting tabs, let us make that the real issue.<br>- Well, if cvs thinks you changed all lines when you only changed white space, isn't it time for a better cvs?<br>Jan-Willem Arnoldhttp://www.delarte.nlnoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-58129941235428562492006-05-18T11:40:11.000-07:002006-05-18T11:40:11.000-07:00Hi Tor, love you on the Posse. Do not love spaces...Hi Tor, love you on the Posse. Do not love spaces, have much love for tabs. Reiterate previous comments, reformatting will make CVS think you have made changes when you really haven't, whereas tabs allows people to view however they want without it giving CVS fits.<br>PS Need more info on Semplice. Have searched java.sun.com site and have come up with diddly/squat. May even be worth upgrading from JDK 1.2 for (just kidding :D )<br>PPS How does Semplice handle the abomination which causes desolation? (AKA 1.5 Generics)<br>Ricknoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-79256335770384529102006-05-17T21:30:40.000-07:002006-05-17T21:30:40.000-07:00>> Regarding argument 1: ... Using Shift-F10...>> Regarding argument 1: ... Using Shift-F10<br><br>And if i do not want/can modify the text ?<br><br>And if the formatter style is not the same ?<br>Why not using spaces :<br><br>- Size of the source file containing 8xSpaces instead of ONE tab char.<br><br>- Source comparators performances (diff,...).<br><br>- Source navigation.<br><br>- Spaces->Tab conversion may not be possible. Tab->Spaces is.<br>Fabdouglashttp://magic-project.sourceforge.net/noreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-2180309697495291442006-04-20T19:10:06.000-07:002006-04-20T19:10:06.000-07:00I also prefer tabs and would argue that argument #...I also prefer tabs and would argue that argument #2 is really about being able to backspace to the previous indenation level with one keystroke. And it's not laziness - if you use spaces and hit the backspace key too many or too few times, all of a sudden you have a line that is in limbo and not lined up at the right indentation level.<br>I don't think anyone will disagree that mixing spaces and tabs are bad. But that's why you should always have published coding standards and force new developers joining the team to read them.<br>Will Hainsnoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-3654809550728399752005-11-16T07:52:45.000-08:002005-11-16T07:52:45.000-08:00Arbitrarily reformatting code using S-F10 just bec...Arbitrarily reformatting code using S-F10 just because you don't like someone's indentation level causes configuration management problems. When you need to commit a real change back to the repository you're expected to annotate what you changed, and why. "I like code to start at column 8" is not a valid reason to obfuscate necessary changes. Diffing successive versions of the code in the repository will show that every line in the file has changed, making it nearly impossible to figure out what the real change is.<br>Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-39037683739829222442005-11-04T03:27:49.000-08:002005-11-04T03:27:49.000-08:00I use tabs and a proportional font to code in. Why...I use tabs and a proportional font to code in. Why ? Because tabs are for indenting. Spaces are for separating keywords.<br>Spaces are so 1990s. Do you still limit the width of your code to 80 characters ? It's 2005 for God's sake lets make some progress here.<br>In Eclipse we can set our own tab = N spaces.<br>Anyone not using Eclipse we have working on chipping out stone boulders into wheels. No kidding!<br>Aaronnoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-14157485950149143542005-09-14T00:18:20.000-07:002005-09-14T00:18:20.000-07:00The one thing to be careful with in your suggestio...The one thing to be careful with in your suggestion is Makefiles. Make requires use of the tab character, so if you switch your editor to always substitute spaces for tabs, then your Makefile won't come out correctly. That being said, I do agree with you on the spaces versus tabs issue.<br>Alex Woodnoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-20866825625038778552005-09-12T02:02:39.000-07:002005-09-12T02:02:39.000-07:00Yes indeed. Thanks, I've updated the entry.Yes indeed. Thanks, I've updated the entry.<br>Tor Norbyehttp://blogs.sun.com/tornoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-50004711729157250492005-09-12T01:06:41.000-07:002005-09-12T01:06:41.000-07:00<q>So why is it bad to use spaces?</q>...<q>So why is it bad to use spaces?</q><br>Shouldn't that read "tabs"?<br>Halvardhttp://www.halvorsen.orgnoreply@blogger.com