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
-
AdrianD3617y@theScientist Well I am not sure if I got this whole thing with tabs vs spaces right, but why would press space four times instead of pressing tab once? Plus when you have to indent to the left you would have to press backspace 4 times or something. I am also quite sure that most IDEs use tabs instead of spaces. :)
-
It still baffles my mind why would someone care about spaces and tabs with all the ides and auto-formatters unless you are using notepad.
-
ChappIO46977yWhat if I like to use 5 spaces?
They provide more interesting beats when I have to enter 20 of them. -
ChappIO46977y@jschmold I know, but I'm a Java developer. We don't really have that problem. The only thing more bloated than our platform is our IDEs.
Everything is autoformatted unless explicitly stated
Combine that with static code analysis like FindBugs and SonarQube and it starts to get real hard to make bad code. (You can still make bad designs though) -
ChappIO46977y@jschmold haha I don't, I like it. I work mostly on large scale enterprise software. I couldn't imagine all the hoops I'd have the jump through if I didn't have an established infrastructure like maven.
-
bb6xt3257y@AdrianD what age are you living in man? Who types spaces nowadays when even nano can be setup to use 2 (or 4) spaces when tab is pressed? Plus you never have to actually tap backspace a number of times just to remove indentation unless you're super paranoid. Just embrace spaces bro. Most JavaScript and Haskell style guides recommend 2 spaces where as the default tab size is 4 or 8, so if you'll reconfigure tab handling anyways why not just set tab to use spaces. Python recommends spaces instead of tabs too.
It is OK if you prefer tabs but wrong to imply that others who use spaces are somewhat bad. Even git can check in tabs/spaces and checkout spaces/tabs if you like. -
nmunro31907y@AdrianD IDEs and editors can be configured to insert 4 spaces instead of a tab character, while still using the tab key.
That way there is no argument, we use spaces, end of, but if you want to use one key to insert the set number of spaces, that can also be done.
Just remap the editor to use tab as spaces then configure the number of spaces. That's how we solved it on the work projects. -
tilde31727yIt does not matter which one you use as long as you can get EVERYONE ELSE on your team to also use the same thing. This is especially important if you're using languages like Python where it'll just stop saying it encountered incorrect indentation if it sees a mix of spaces and tabs.
-
@triggerHappy @theScientist @jschmold @tilde
The reason to use tabs is for consistency. "indentation" if all done in tabs can be consistent to each developers style of tab size. When done with spaces this is not the case.
Alignment (as opposed to indentation) should never be done with tabs and should be done exclusively with spaces.
Related Rants
It still baffles my mind why anyone would prefer spaces over tabs.
undefined
tabs vs spaces