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

<< < (3/7) > >>

wraith808:
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?
-Deozaan (June 19, 2017, 12:40 AM)
--- End quote ---

I'm saying that tabs can be set to anything, and interpreted differently in each editor.  Spaces give more consistency, and there is no interpretation involved.  And when I say VCS, I mean a Version Control System.

Some VCS' don't do so well with tabs in my experience.
-wraith808 (June 18, 2017, 10:28 PM)
--- End quote ---

f0dder:
Using spaces for indentation is stupid.

It's treating a semantic piece of information as visual formatting, and that by itself should be enough to disregard space-formatting.

As Deozaan says, it also means that you (you special snowflake!) is trying to dictate how wide my indents are supposed to be, instead of letting that be up to my editor settings. Editor settings that probably vary depending on whether I'm on a machine with big monitors, or editing in Vim through SSH.

I've never seen indentation be a problem for VCS (any of the modern ones, anyway - pre-subversion days don't count), unless you've got non-team-players that insist on reformatting files instead of sticking to the project standard.

The only place where you might need "consistency" is if you have tabular data represented as code - and that's easily solved by tabs-for-indent, spaces-for-alignment, which is a fine compromise until everybody is using automagical IDEs that don't care about source representation and do on-screen format based on language rules :-)

MilesAhead:
Most of the dedicated Python editors I have encountered have settings to strip tabs and indent with the number of spaces the user sets.  In Python the indentation is the only indicator of the beginning and end of blocks.  You don't have curly braces or "begin" and "end" keywords to fall back on.  It can get funky fast if you load someone else's Python source code with hard tabs unless the editor can auto convert the tabs for you.

That is the best reason I have found for insisting on spaces.  As I have gotten older I have gone from tab to 4 spaces to 2 spaces for indentation.  I hate it when source wraps to the next line or kicks in the horizontal scrollbar just because there were a few nested blocks generating a bunch of white space.

f0dder:
I consider languages insisting on indentation for semantics (like Python) to have made a really bad choice in that regard. The intention might have been to make program structure clearer, but it's dictatorial "we know better" that doesn't belong in a language, and it ends up causing more troubles than it solves.

I hate it when source wraps to the next line or kicks in the horizontal scrollbar just because there were a few nested blocks generating a bunch of white space.-MilesAhead (June 21, 2017, 03:11 PM)
--- End quote ---
You're either using a very, very narrow monitor (for professional development I've been on 120 columns with plenty of real estate for an IDE for 5+ years), or having crazy amounts of indents.

I've been using tab-is-4-spaces indenting for some 15+ years, but I'm considering changing that to oldschool 8, since it forces you to reduce indentation - preferably by splitting your code into shorter, coherent functions.

Tuxman:
I consider languages insisting on indentation for semantics (like Python) to have made a really bad choice in that regard.
-f0dder (June 21, 2017, 04:33 PM)
--- End quote ---

^ Pretty much this.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version