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
-
tahnik389918y@saiphp that's the thing about tabs. Tab helps us not to worry about this spaces, because it's editor dependent. Spaces on the other hand, is not. It's a hacky way of indenting.
-
Just set your soft tabs to two spaces and be done with it? You can still use the Tab key, it just doesn't use "\t".
Most editors these days know how to interpret and convert to 4 spaces should you need. -
tahnik389918y@saiphp it's not a thing of the past. Using rules like this means you are imposing rules on the developer. The width of indentation should always be a personal preference of a developer, not something that is forced on them.
-
@tahnik while agree with this on personal projects. Every developer using their own indenting methods makes for an inconsistent codebase when collaborating. Code consistecy should always be strictly enforced, even of it means that some "spaces developers" have to use tabs
Also tabs > spaces -
tahnik389918y@theaviator well what I am trying to point out. If you use tab, then no one has to enforce anything. Do you like 2 spaces? fine, change the tab size to 2. Do you like 4 spaces? change the tab size to 4. Easy and simple.
-
tahnik389918y@TuxOtaku you can control your editor. You can set the tab width in most of the editor.
-
Semantics, semantics, semantics! This is one of my biggest pet peeves. Spaces are for spaces, tabs are for indentation. It's not fucking hard. Use the right tool for the job! Spaces are not the right tool. Tabs have no other purpose than for indentation and they give you the flexibility to set the indentation size to you own preference in most editors. There is no argument for the use of spaces other than pure stubbornness.
-
timurtu578yHow nested is your code because 2 spaces is perfect for me. Anything more would cause my lines to reach the next line.
-React/Node dev -
Does the project have an editorconfig file? In that case you should be able to get your editor to follow the conventions. If it doesn't have an editorconfig, PR one first!
-
@TuxOtaku If you think 1 space makes it unreadable than you're doing something wrong
-
Please follow the godamn project rules and style guide. Worst than tabs OR spaces is having both tabs AND spaces.
-
ziemek99368yYou can always write privately on your hard disc with tabs. Right before committing just use "find and replace" to exchange each tab with 2 spaces.
I'm tab lover and this is how would I behave in your situation :-)
Related Rants
Well, I guess I won't be able to contribute cause tabs for life
undefined
space
tab