ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > Living Room

Developers who use spaces make more money than those who use tabs

<< < (2/7) > >>

mwb1100:
...those who don't indent at all *shudders*
-Stephen66515 (June 18, 2017, 03:41 PM)
--- End quote ---

They've done so well for themselves, they don't have to program anymore.

wraith808:
I was taught to use spaces, and had done so for years. But then a couple of years ago I actually thought about it instead of just dogmatically accepting what I was taught and I came to the conclusion that tabs are better because they give more choice to each individual.
-Deozaan (June 18, 2017, 03:38 PM)
--- End quote ---

The reason I use spaces is for exactly this reason.  Consistency in code, as you can set the tab to be anything, and get unusual alignment when using tabs.

Shades:
Consistency with indentation, no matter in which IDE/editor you open your code in, is really helpful, especially in multi-programmer projects. A tab can be set to whatever default, depending on user preference and software to edit code with. And it is easy to add an accidental tab that won't show up in one piece of software and disrupts indentation in another.

Spaces do not cause such problems in any editor/IDE in whatever (regional) language. And using spaces hardly takes up that much extra storage on disk. My anecdotal experience is that using spaces works better/consistently within whatever versioning system I have tried over time. But that can be just me.

wraith808:
Consistency with indentation, no matter in which IDE/editor you open your code in, is really helpful, especially in multi-programmer projects. A tab can be set to whatever default, depending on user preference and software to edit code with. And it is easy to add an accidental tab that won't show up in one piece of software and disrupts indentation in another.

Spaces do not cause such problems in any editor/IDE in whatever (regional) language. And using spaces hardly takes up that much extra storage on disk. My anecdotal experience is that using spaces works better/consistently within whatever versioning system I have tried over time. But that can be just me.
-Shades (June 18, 2017, 08:54 PM)
--- End quote ---

Nope, I totally agree.  And you bring up a good point - VCS.  With spaces, they are stored consistently.  Some VCS' don't do so well with tabs in my experience. But that might be better now.

Deozaan:
I came to the conclusion that tabs are better because they give more choice to each individual.
-Deozaan (June 18, 2017, 03:38 PM)
--- End quote ---

The reason I use spaces is for exactly this reason.  Consistency in code, as you can set the tab to be anything, and get unusual alignment when using tabs.
-wraith808 (June 18, 2017, 07:37 PM)
--- End quote ---

I'm not sure I follow you. How does using spaces give more choice to each individual? And how does it provide any more consistency in code than tabs do?

One tab-width indentation is always exactly as wide as you've configured it to appear to you. You can't get any more consistent than that.

But once you decide to use spaces, then you have to determine how many spaces to use per indentation block. Some people prefer 2 spaces. Some (most, I think) prefer 4. Some do weird things like 3 or 6 or even 8! And if you're working on a project with someone (or with a library written by someone else) who prefers a different amount of spaces than you, you no longer have consistency. One or both of you needs to compromise and submit to the others' spacing preference.

With tabs you can just use tabs, and configure your IDE to display it how you want it to appear to you. And others can configure how they want it to appear to them. Everybody wins. It's the most accessible and friendly way to get it to look how you want it to look and to allow others the same privilege, even if all parties disagree on what looks best to them.

In summary:

* Spaces are dictatorial in that they enforce your preference on others, whether they like it or not.
* Tabs allow each individual the freedom (and responsibility!) to configure it to appear in whichever way pleases them most.
That said, if VCS doesn't properly handle tabs (which hasn't been my experience) then that's not the fault of the tabs. It's the fault of the crappy version control software (or GUI client written for the VCS).

In practice, it doesn't really matter to me which I use. But I'm still of the opinion that tabs are The Better WayTM since they allow the most freedom for everyone involved to view the code how it looks best to them.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version