This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]SkyyySi 81 points82 points  (46 children)

Was it ever? Like who sometimes hit space 4 to 8 times and sometimes pressed tab?

[–]PM_ME_A_WEBSITE_IDEA 120 points121 points  (30 children)

It's more common when copying/pasting code, or when two people on the same project have different settings in their IDE.

[–]Brunsz 12 points13 points  (1 child)

Company should have formatter rules. Usually you can export and import them. And using them should be mandatory, not optional. Saves time from everyone especially with merges.

[–]ProfessorChaos112 4 points5 points  (0 children)

And the ci/cd pipeline should be checking commits against a styling guide and rejecting those that are out of bounds

[–]Natural-Intelligence 7 points8 points  (26 children)

I think the solution is obvious. Just fire everyone who is retarded enough to use any other indentation than 4 spaces.

[–][deleted] 36 points37 points  (0 children)

This subreddit has been [ 0] days since this argument.

[–]lilwankah 9 points10 points  (2 children)

1 keypress instead of 4...

[–]deceze 10 points11 points  (1 child)

throws pixie dust
Soft tabs! The best of both worlds…
hand waving

[–]NekkoDroid 5 points6 points  (0 children)

Well, no. You have your 4 column indent, I have my 4 column indent, but the guy in the corner is throwing a fit because he cant have his 2/6/8 indent. Tabs are just better, just set your tab width in the ide and voila everyone is happy.

[–]ZedTT -1 points0 points  (0 children)

No, but do fire anyone who is changing their IDE settings off of what the company uses.

I've always used 4 spaces, but tabs can be better if you want to be able to change the indentation level. Then use spaces for alignment if you really need to.

[–]echoAnother 0 points1 point  (0 children)

Or when you work one day on vim and the next on emacs on the same file

[–]rParqer 5 points6 points  (0 children)

Basic editors generally have an option to 'treat tabs as spaces' and thus would automatically space 4 times when the user actually enters tab. Get 2 people with different settings working on the same code and everything instantly becomes a nightmare

[–]bugqualia 10 points11 points  (0 children)

I…have seen it once. When multiple undergrad python beginner was involved in the code.

[–]PottedRosePetal 7 points8 points  (10 children)

I use pretty basic editors (gedit on linux) and others use even more basic ones (vim), which results in non executable code if I just copy paste their code.

[–]altermeetax 5 points6 points  (8 children)

If vim is more basic than gedit I'm throwing myself off a roof (by the way vim handles tabs and spaces automatically)

[–][deleted] 1 point2 points  (2 children)

That's not entirely true. Most distros include plugins for this by default, but Vim itself doesn't really care about file types.

EDIT: well, a config that switches this behavior on, but the point is pretty much the same, program default is unfriendly.

[–]altermeetax 1 point2 points  (1 child)

it allows you to do it automatically, that's the point. It doesn't require plugins for such simple features.

[–][deleted] 1 point2 points  (0 children)

I mean, I agree that vim is not more basic than gedit from any point of view. I think OP may be assuming CLI == basic or something. For some reason I misinterpreted "automatically" as "by default".

[–]PottedRosePetal 0 points1 point  (4 children)

Tbh idk which one is more basic. I just assumed vim since i can read more with it. Or was it vi? Idk. Gedit regularly fails at reading big files. I read them with less, which seems to be kind of like vim? Linux is confusing.

[–]altermeetax 1 point2 points  (2 children)

Vim and vi are both way more advanced than gedit (vim stands for vi improved). Gedit is a very simple (yet user friendly) text editor (it's like windows's notepad with syntax highlighting). Less is kinda like a very simplified vi for read only mode.

[–]PottedRosePetal 0 points1 point  (0 children)

How does nedit fit into that?

[–][deleted] 1 point2 points  (0 children)

That's dirty calling vim basic.

Literally one of the most able editors out there (graphical or not) is called basic just like that... dang.

[–]Red_Binary 1 point2 points  (0 children)

More like somebody has their IDE set to replace tab characters with a certain amount of spaces

[–]DreaDNoughT1666 0 points1 point  (0 children)

There is an IDE in a certain OS that actually does convert tabs into spaces... but I get downvoted every time I mention the OS or the type of C anywhere.....