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
-
It really doesnt matter, choose the you feel more confortable with or the one you are forced to use at work. We dont wana start a religious war here :)
-
Thats a bad idea choose one and Stick with it. Everyone else reading your code is going to hate you >:D
-
@GMR516
I'm just kidding lol. xD
I'm not going to convince you to use either because everyone has their own preferences. You might like tabs or you might like spaces. I personally like tabs, but if you use spaces, that's cool too. -
@GMR516
Yeah haha. I was pretending to be stack overflow earlier, but I don't think you got the joke.
That's okay tho, I could've done it better anyway. :) -
Whatever you choose make sure your linting tools support in the commited config file
This way all the team uses the same convention -
CptFox16167yI think tabs make more sense, but python conventions say spaces and linters annoy you if you do otherwise, and I've heard of studies saying devs that use spaces have better salaries, so I use spaces π
-
C0D4669027yI press the tab key, but I setup ides to convert to spaces.
This saves me bashing a space bar more then I need too
When you’re using github or something for code review, everything is formatted nicer then when you actually use tabs.
Other then that, use what you want to use, there’s no real right or wrong side, or be me and fake the spaces. -
CptFox16167y@irene They are a unit of indentation, and everyone can set their text editor to display them with whatever width they please. They are a single character, so deletion behaviour doesn't depend on your text editor : one delete = indentation--, even in a poorly configured nano. They are perfectly well handled in any system. There isn't any reason why they would be bad for indentation, and plenty reason why they're better than spaces.
BUT I'll just use whichever is asked of me by conventions, regardless of that opinion of mine. Since most of what I do now is in python, that means spaces.
So in return, why do you think spaces are better ? Not "as good", "better", is what I'm asking. Ignoring current conventions (those can be changed) and the salary thing (unless you have a reliable source, in which case, I'm curious) if possible -
CptFox16167y@irene Now I'm curious about what system wouldn't handle tabs correctly, do you have examples ?
-
CptFox16167y@irene GitHub handles tabs fine, and you can even pick your indent size with the ?ts argument, try changing the one in this link with any integer between 1 and 12 :
https://github.com/jquery/jquery/...
If anything, I'd say GitHub is yet another reason to prefer tabs (also, although I admit to the fact that having a tab size of 8 by default is weird, it would still qualify as 'handled fine' if it couldn't be changed, as the indents would still be perfectly clear and readable, and not cause any harm that some crazy 8 spaces indenter wouldn't accomplish) π
Any other poor tab handlers come to mind ?
Related Rants
Why should I use tabs or spaces? Convince me of your side. :)
question
tabs vs spaces