bugmonotone - Bugs: bug #8537, Tabs are evil

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #8537: Tabs are evil

Submitted by:  Nathaniel Smith <njs>
Submitted on:  Sun 11 Apr 2004 06:47:54 AM UTC  
 
Category: NoneSeverity: 1 - Wish
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Closed
mtn version --full: 

(Jump to the original submission Jump to the original submission)

Thu 06 Oct 2005 06:50:50 PM UTC, comment #9:

Simple rules:

1. Do not mix tabs and spaces, ever.

2. Do not use tabs to begin with.

Check this page: <a href="http://orefa.com/misc/spaces_only.html"> http://orefa.com/misc/spaces_only.html </a> for plenty of good reasons.

Anonymous
Fri 29 Apr 2005 09:09:18 AM UTC, comment #8:

Reply to comment #6:

You argue that you could use only tabs and be safe, but it's impossible to only use tabs for indentation if you (like most people) want to align function arguments on several rows. (Tabs should only be used for logical indentation steps, otherwise the function arguments get unaligned when the tab size is changed, right?) To only use spaces for indentation is therefore safer since it avoids mixing tabs and spaces.

Anonymous
Fri 29 Apr 2005 09:05:18 AM UTC, comment #7:

I think this bug has reached the end of its useful life.

Nathaniel Smith <njs>
Project Member
Fri 29 Apr 2005 08:35:09 AM UTC, comment #6:

You argue that mixing tabs and spaces is bad, therefore tabs are bad. The logical error being commited is called Fallacy of Division, (http://en.wikipedia.org/wiki/Fallacy_of_division) .
You could just as easily argue that spaces are "evil" using the same reasoning.

Just use either one OR the other consistently. 50% of zealots will be upset either way, but them's the breaks.

Anonymous
Sat 09 Apr 2005 01:12:26 PM UTC, comment #5:

No; tabs are evil. What you say is just too difficult to achieve to even try. I wrote about it here:

http://www.livejournal.com/users/jmmv/27720.html

Julio Merino <jmmv>
Project Member
Thu 07 Apr 2005 01:00:20 AM UTC, comment #4:

Code should always be tabbed as you then have a consistent way of identifying the code hierarchy. - 1 token (tab) per level.
This also allows each person to render the tabs in their favourite fashion.

Anonymous
Wed 16 Feb 2005 09:11:31 AM UTC, comment #3:

I have a little awk script around that I use in my projects which verifies some basic rules on source code. Basically, it ensures there are no tabs used for indentation, than no trailing whitespace appears in lines, that lines are not longer than 80 columns, etc.

To automate things, I add a hook in the makefile, called 'lint' which calls awk with the above script over all the source files in the project. The result is a list of items that need to be fixed (and make exits with an error).

This 'lint' target can be added as a dependency to distcheck-hook so that published distfiles never suffer from this problem (in fact, this is to always remind you of existing formatting problems at certain important dates).

I think it may be good to add that script in monotone, if there is interest. We'd avoid the distcheck-hook change for now, because the script could trigger a lot of problems. But having the 'lint' target around may be nice.

Finally, we'd simply need to sweep through the code (some sed expressions should be enough) to convert tabs to spaces and to remove trailing whitespace. After that, we'd enable the distcheck hook. Unfortunately, the patches to do this will be (probably) giant, so I'm not sure it's really wanted...

Julio Merino <jmmv>
Project Member
Tue 20 Apr 2004 09:11:00 AM UTC, comment #2:

You seriously deserve a beating for above comment.

Anonymous
Mon 19 Apr 2004 04:43:22 PM UTC, comment #1:

Seconded. And in the same code-pedantry department: It's also common with rows having trailing whitespace.

Joel Rosdahl <jrosdahl>
Sun 11 Apr 2004 06:47:54 AM UTC, original submission:

The smallest bug on the list, but...

Tabs are never a good idea in source code, because they have inconsistent interpretation, etc. (I'm sure everyone has heard the arguments before.) Monotone has lots of tabs in its source code. This should be fixed.

(This is particularly annoying because, not ever wanting tabs in my source code, my emacs is set up to remove them automatically; this makes editing monotone source code without creating giant patches very difficult...)

Nathaniel Smith <njs>
Project Member

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follows 1 latest change.

Date Changed By Updated Field Previous Value => Replaced By
Fri 29 Apr 2005 09:05:17 AM UTCnjsOpen/ClosedOpen=>Closed

Back to the top


Powered by Savane 3.1-cleanup1