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
-
setyadi7318y@FitzSuperUser Different editor has different perception of how much indented a tab is. So, long ago, when you opened something that was written in editor A in editor B, the indentation can look different. That is why old coders use spaces, so that their code looks the same everywhere. And that is also why current editors offer to convert our tabs into spaces. So what you say tabs could be actually implemented as spaces in your editor.
-
@setyadi current editors also have the option to set the tab-width.
I am a tabs guy too, so i really hate it that the style guide of python wants spaces only. Python is not yaml. Who is offended by tabs so much? -
@darksideplease Never stopped me from using Tabs in almost all my Python code. 😂
-
I generally like to use Tab = 4 spaces in all my editors.
For web dev, Tab = 2 spaces. The nested indentation gets insane if wider than 2. -
@FitzSuperUser Sorry. Tabs for indent, space for align, is a common scheme. The point of using tabs is (among others) that different users might like different tab width. If you use tabs exclusively, aligning this won't work:
-
@FitzSuperUser Add to that the fact that most coding standards have a column limit, which only really makes sense if the tab width is defined. Having a tab width fixed for every dev kind of kills the point.
-
Grumpy28828yI love the surprises I get from tab formatting. Tried my way through 4,2 and 8 recently for something I got from GitHub, but alignment errors were everywhere.
Then, I discovered that 3 was the setting the author had used. And since the editor I used (VS2015) doesn't remember tab setting per source file, I had to set it back to four to make all other projects decently aligned.
And of course, for languages using offside rules instead of curly braces, the compiler needs to know the different tab setting for every file too. Yes, tabs are such fun because everybody has their own setting and nobody knows the difference between indent and alignment. -
@XiovV if you're using a decent IDE or editor, it will have a setting that can assign a given number of spaces to be the result of pressing the tab key. Which is what any sane person would do. 7 is indeed a strange tab width number, but yes you can even set up your editor to make the tab key yield 7 spaces.
-
Grumpy28828y@XiovV Eh? You know that the tab/spaces debate is about what characters are stored, not about what keys are pressed. Whether you use tabs or spaces, you always press the tab key, never the space key.
Seriously for the life of me I don't know why anyone would choose spaces over tabs
undefined
i'm being serious