Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Why would you use spaces?
I'm probably just biased because I'm a writer, but I'd rather not use spaces.
In the writing industry, if you use spaces instead of tabs on your manuscript, that's an automatic rejections. Agents and publishers hate it because a tab is equal to about 6 spaces. You might do 5 or 7 by accident.
Programming is the same way. Your code won't appear as attractive without tabs. It'll look crooked.
Also, tabs are easier than hitting spaces 6 times. -
First of all, use tabs. Fuck spaces.
Secondly, if you have to use spaces, use 4 fucking spaces. -
Root797787yOh no, I might hit space 3 or 5 times instead! Goddamn really?
Well how about no because this never happens? Ever? Because it's really freaking obvious when things aren't aligned?
Also, the tab key is a thing. Any editor worth its disk space inserts the proper number of spaces automatically. So nobody actually hits space space space space like a dumbass.
Furthermore.
Aligning ex. Multiple declarations with a type length that isn't a multiple of tab_width (e.g. char) or multiline arrays in a conditional isn't possible with tabs. "Oh, just set your tab size to x then!" Fuck you then it breaks for everyone else AND you suck. Grats.
There's almost always ways to refactor the code to avoid these issues, but that is often simply not worth the effort and/or makes the code less readable.
Spaces > tabs. -
Kaji20977yNothing worse than dropping a 2-space block of code into a project and then having to sort out the indentation all over again...
-
Root797787y@daegontaven I was arguing for spaces, not against 😋
... while very pissed off at an irl coworker ...
so it came across really bitchy. Sorry! -
I prefer tabs for the following reasons:
- clean single char indentation
- copy/cut and paste is always clean because there is no risk taking spaces from indentation with you thus creating misalignment
- smaller file size (not very important)
- the length of the tab char can be changed in most editors, while changing space width or from x spaces to y spaces is more complex for an editor
- no redundant characters
- does not trigger OCD
- the tab key is for tabs not multiple spaces thus the name tab key
- no need to hit the space key multiple times = less noise for coworkers
Some of these arguments are not to be taken seriously.
I personally think that if it's not a company policy to use spaces for indentation or it is required by the project, one is insane to use spaces over tabs. But that's just my opinion and I respect other opinions.
If I have to work on space indented sourcecode I get seriously mad. It is the worst when you have to move around blocks and always have to select codeblocks extremely precise to not take spaces with you. And some fuckers just dont care when there is a space less or more in front. FUCK SPACES. -
Root797787y@Condor must be pretty large files if indentation makes a noticeable difference in transfer time 😮😋
-
@kenogo I don't think you will commit your source files to git with gzip. 😁
@Cpndor Compression is not really an argument for tabs. There are other much more valid and evident reasons to prefer tabs.
But we all can agree that tabs vs. spaces mostly is a discussion about personal preferences and in most cases doesn't need a discussion. -
@Pizza You know this statement is not valid at all.
Spaces/tabs don't have any influence at all on how much you earn. -
@daegontaven Please no chat feature requests. There is a Telegram channel for devRant and it is already bloated with hundreds of comments per day.
What devRant probably needs is less memes, childish conversations and "buhuuu I have no gf"-rants. 😉 -
-
micropi357y@Michelle using spaces is not actually hitting space several times. The space that is created is actually made of spaces, but you still press tab. Tabs can be different length however spaces are usually always same length everywhere, which is why people prefer them, I think.
Seems like majority of people in this thread think that using spaces is having to hit space bar multiple times :P
Again, using spaces is using same tab button but instead of usual tab it creates 4 spaces. -
heikomat6867y@micropi THANK YOU!
When I was reading these comments I was like: do they really think, indenting with spaces means using the space key?
This discussion is purley about the content of the code, NOT about what keys were pressed to create it, because you need the exact same keypresses for both, tab-indentation and spaces-indentation. -
I don't get the whole "spaces vs tabs" thing.
All my IDE's and text editors auto-indent most of the time, when I need to adjuat I normally use tabs, sometimes spaces for very small adjuatments for which tab is too large. -
@micropi but what if a colleague of yours prefers 2 spaces worth of indentation? If you just let the editor input tabs when you press tab, they could set the display width to 2, and so can you, set it to 4 :)
Also, I would think using tabs will cause your code to be more efficient. 4 characters is a redundant way to express 4 characters worth of nothing, when you can express it with a single tab.
When half your team uses spaces and the other half tabs... Thank god IDE can convert tabs automatically now but now we are arguing if we should use 2 or 4 spaces. It never ends...
joke/meme