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
-
SHA-25614478y@g-m-f They should be forced to program stuff in python...have fun with the mixed indentation giving you errors ^^
-
I prefer spaces. used tabs around 4 years. Anyways modernd IDEs will correct itself and autoindent them but spaces FTW!
-
@croccifixio I think they meant tabs for indent, spaces for lining things up
IE:
Thing thing = new Thing( new Other( {
Id = 1,
...
}));
Something like that, I'm just making shit up -
SHA-25614478y@runfrodorun well indenting with space manually would be a bit dumb...(being a python guy it would be too error prone as well)
-
@croccifixio yeah that's a better example. That way tabs can be set up by the reader, but the other stuff is still lined up
-
SHA-25614478y@runfrodorun yeah probanly....I don't think there would be so many people seriously using Tab
-
@SHA-256 they don't, they just think they are because of text editors and IDEs that translate tabs to spaces.
-
Bikonja23868yI don't care whether it's tabs or spaces, as long as I can:
A) change a setting to change how wide the whitespace is
B) press a key once for one level of indentation
With that said, tab is literally designed for that so why use spaces? Sure, modern editors may be able to parse both, but why oh why would you discard a key made for that exact purpose in favour of something that's not?
Similar to using Enter instead of adding a page break... -
SHA-25614478y@Bikonja I use the tab key on my keyboard...sublime text converts that to 4 spaces and that's how it should be
-
Bikonja23868y@SHA-256 why? Did you read my comment fully? I want a reason why people think spaces are better. I'm ok with people saying they like them better, but only in their own use, not imposing them to others because they like them better than a tailor made solution.
-
SHA-25614478y@Bikonja
I probably prefer spaces since I do stuff with python and Haskell, two languages which depend on indentation...using spaces makes it way more consistent... especially when working in a team. Why I use 4 Spaces ? because pep 8 says so and I don't have a reason not to use 4... -
SHA-25614478y@Bikonja Also spaces provide consistency in the formatting of code where indentation doesn't matter...
-
Bikonja23868y@SHA-256 but you always use the same indentation levels, right? As in, if you use 2 spaces then it's always 2, 4, 6, ... It's not 3 or 5... And if you use 4 spaces it's always 4, 8, 12, ... Never 2, 3, 5, ... Right? In that case, you have the same amount of consistency with tabs, with the added benefit of not needing to think about how many spaces are there, but rather how many indentation levels and then you can say your indentation is x pixels instead of x spaces if you like it that way... So consistency is actually the main reason to use tabs over spaces, unless you need sub-indentation level indentation.
-
Bikonja23868y@SHA-256 Only if everybody uses the same amount of spaces. If everybody uses tabs then everybody can set the spacing to whatever they like, but the codebase is consistent for everyone. It can, however, be inconsistent between developer environments i.e. one developer does not have to have the same tab width as another so when you come to another developer it might look like he uses less or more spaces than you, but it's tabs so it's consistent in the code base, but not in display. Which is true for font size and style, coloring, etc. as well so that really shouldn't be an issue, unless you also think everybody should use the same font, font size, colors, etc.
-
Bikonja23868y@SHA-256 Yes, it is... It's also consistent that variable names are pascal case if that's in the styleguide and everyone adheres to it. If it's consistent because of everyone following a style guide that says something about it then it's consistent even if you use 3 tongue-out smiley faces for indentation. Doesn't mean there's not a better alternative :)
We finally win (source: https://stackoverflow.com/insights/...)
undefined
battle
tab
space
stackoverflow