tag:blogger.com,1999:blog-3283609923804350642.post7555731456325029154..comments2023-06-05T23:03:15.094-07:00Comments on Tor Norbye's Blog: Tabs Are Evil, Part 3Tor Norbyehttp://www.blogger.com/profile/00746799716822637466noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-3283609923804350642.post-40946335971258461122006-09-22T03:32:05.000-07:002006-09-22T03:32:05.000-07:00I have no oppinion about TAB vs. spaces.I'm wo...I have no oppinion about TAB vs. spaces.<br>I'm working for a company at the moment witch has an ant script which will format your code according to theyr coding style. So I just code someway and the ant script generates the approved version of my code. White spaces and all these silly things you wine about can be fixed by running my code-style ant and then before commit company code style.<br>Birkirhttp://ferdalag.nt.isnoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-31740056544671289252006-09-20T23:55:15.000-07:002006-09-20T23:55:15.000-07:00I don't think those two scenarios are equivale...I don't think those two scenarios are equivalent. If people are using tabs, its pretty easy to -accidentally- insert spaces to indent. If people are using spaces, they are pretty much -intentionally- doing their own indent levels. One of the most important rules about good coding practice is to follow the coding style that is already present in the file you are editing. Doing your own indent level, especially within a method, is either very lazy or very rude.<br>Tor Norbyehttp://blogs.sun.com/tornoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-70304425244082475352006-09-20T06:59:48.000-07:002006-09-20T06:59:48.000-07:00JWZ on tabs vs spaces is well worth a read:http://...JWZ on tabs vs spaces is well worth a read:<br><a href="http://www.jwz.org/doc/tabs-vs-spaces.html" rel="nofollow">http://www.jwz.org/doc/tabs-vs-spaces.html</a><br>Joe Walkerhttp://getahead.ltd.uk/blog/joenoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-53390490215128705752006-09-20T00:27:51.000-07:002006-09-20T00:27:51.000-07:00Why is just about everything I post being flagged ...Why is just about everything I post being flagged as spam ?! Grumble.<br>Mark Hattonnoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-45193079948098258942006-09-20T00:24:02.000-07:002006-09-20T00:24:02.000-07:00(continued from prev. comment, apparently I was sp...(continued from prev. comment, apparently I was spamming?!?)<br>I'm not saying I prefer tabs over spaces but the mixed approach does allow everyone to choose a tab width they prefer.<br><br><br><br>I submitted to using spaces over tabs long ago though because other developers use that approach and the two don't easily interoperate.<br>Mark Hattonnoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-88364286982753731802006-09-20T00:21:52.000-07:002006-09-20T00:21:52.000-07:00You could argue that the only line in your example...You could argue that the only line in your example with incorrect indentation is the line which uses only spaces, i.e. line 2. Line 3 may have a mixture of tabs and spaces but the tabs are being used to signify the indent level of the code and spaces are used for formatting (aligning the throws keyword with the method return type in this case).<br><br><br><br>The advantage of this approach is that it doesn't confuse code indents with formatting and thus allows other developers to use any tab width they prefer. In your example the only line which would appear to have the wrong indent if you were to alter the tab width is line 2, line 3 would still look cool.<br><br><br><br>Though I don't use this approach myself.<br>Mark Hattonnoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-33932711281065474822006-09-20T00:12:33.000-07:002006-09-20T00:12:33.000-07:00Given your example you could argue that the only l...Given your example you could argue that the only line with incorrect indentation is the line which uses no tabs, i.e. line 2 (the beginning of the method sig).<br>Line 3 may have a mixture of tabs and spaces but the tabs are being used to signify the indent level of the code, on top of which spaces are used for formatting (aligning the throws keyword with the return type of the method in this case, which just happens to be 8 spaces).<br><br><br><br>The advantage of this approach is that it doesn't confuse code indents with formatting (pretty-fying) and thus allows other developers to use any tab width they prefer, without corruption.<br>In your example the only line which would appear to have the wrong indent if you were to alter the tab width is line 2, line 3 would still look cool.<br><br><br><br>Now I'm not saying I prefer tabs over spaces but I did used to work this way since it allowed everyone to choose the tab width they preferred, without corruption. I eventually submitted to using spaces only because other developers used that approach and they don't easily interoperate.<br>Mark Hattonnoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-58312374532696343902006-09-19T05:18:58.000-07:002006-09-19T05:18:58.000-07:00So why not configure your editor to show tabs in s...So why not configure your editor to show tabs in some way, the same way you can display non-printable characters in any decent word processor?<br>Jasper Bryant-Greenehttp://jbg.name/noreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-50259197035954411482006-09-18T22:34:59.000-07:002006-09-18T22:34:59.000-07:00That reminds me: when I was working in the Swing T...That reminds me: when I was working in the Swing Team, code reviews would reject any change that would include tabs in the source code :)<br>Romain Guyhttp://www.progx.orgnoreply@blogger.com