python... tabs == devil in python.
Why I prefer no tabs in source code
11–20 of 37 posts
Re: Why I prefer no tabs in source code
#12Nearly every editor I've used allows you to adjust tab size. In my mind, that means tabs allow every user to set the width that they prefer.
Re: Why I prefer no tabs in source code
#13Re: Why I prefer no tabs in source code
#14Do you not people see these two twin (troll?) threads posted by the same person? Within the same minute?
http://news.ycombinator.com/item?id=1058196 http://news.ycombinator.com/item?id=1058195
Someone went out of his way to find two trivial, but hot-button issues and submitted an argument for each. It's another "experiment".
Re: Why I prefer no tabs in source code
#15python... tabs == devil in python.
You're being modded down as that's not a complete sentence, but yes, since there's a standard (PEP 8) stating that spaces are preferable to tabs, and that indentation should be 4 characters, and all modules I've seen use that standard, tabs are indeed looked upon as being bad in Python.
Additionally, tabs are 8 spaces to the python interpreter. If you're not using 8 space tab stop, you're setting up people who use your code for a world of hurt if they ever change anything in your files.
Re: Why I prefer no tabs in source code
#16Re: Why I prefer no tabs in source code
#17Oh yes. Tabs or spaces in source code. That's really what makes software great. Just have guidelines and stick to them. What sucks is inconsistency. Everybody's got an opinion about code layout. It doesn't matter. There's no good or bad layout. Readability is just another word for "looking like stuff I'm used to read".
Now whenever I read python code that is outside of PEP8 just a little bit, it makes me cringe, but I can still read other, non python code indented almost any way. Thought that was interesting.
Re: Why I prefer no tabs in source code
#18Oh yes. Tabs or spaces in source code. That's really what makes software great. Just have guidelines and stick to them. What sucks is inconsistency. Everybody's got an opinion about code layout. It doesn't matter. There's no good or bad layout. Readability is just another word for "looking like stuff I'm used to read".
What's interesting is that I never used to care how code was indented, never bothered me. However, I got a job using Python/Django, and almost all of the code in that community is in the PEP8 style (4 space indents, etc, http://www.python.org/dev/peps/pep-0008/ ). Now whenever I read python code that is outside of PEP8 just a little bit, it makes me cringe, but I can still read other, non python code indented almost…
Re: Why I prefer no tabs in source code
#19Earlier quoted context omitted.
You're being modded down as that's not a complete sentence, but yes, since there's a standard (PEP 8) stating that spaces are preferable to tabs, and that indentation should be 4 characters, and all modules I've seen use that standard, tabs are indeed looked upon as being bad in Python.
It's not just that. The REASON why tabs are so bad is because it makes very very subtle errors when they get mixed. Additionally, tabs are 8 spaces to the python interpreter. If you're not using 8 space tab stop, you're setting up people who use your code for a world of hurt if they ever change anything in your files.
Re: Why I prefer no tabs in source code
#20Tabs aren't just used at the beginning of lines. There might be a left-aligned, multi-line comment to the right of a block of code(...)
I cannot fathom what point he thinks he's making with these. If you're using tabs in a way that depends on tab width, you're doing it wrong.
Tab indentation generally means that one tab character is one layer of indenting. That's it. It's about semantic structure, not layout.
If you want to make ASCII art, or align things like paragraph-style comments, or "indent" things that aren't part of a block of code like pieces of a lengthy conditional clause split over multiple lines, use spaces instead (and then the five people who use proportional fonts will complain that using spaces for alignment "isn't portable"). Of course, if you're using a language with an off-side rule for syntactic whitespace even a die-hard tabber ought to just use spaces.
Personally, I dislike that sort of non-semantic formatting business in source code (and I think off-side rules in syntax are a horrible idea), but that's a matter of taste. And obviously, consistency is vastly more important than the particulars of indenting style. But I get tired of people arguing against tabs on the basis of not knowing how to use them properly.
On the other hand, this unintentionally makes a different, very strong argument in favor of using spaces: people can't manage to use tabs properly, so don't let them. This is why we can't have nice things, folks!