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
-
crani8708yHow about we just learn to accept both styles? It's all the same once it is compiled into machine code.
-
@crani that's a beautiful way of thinking, very inclusive and fair, but what if we learn to be smart and converge to a single practice? It doesn't make any difference for compilers indeed, but when it comes to a team working on the same code, having people with different styles committing together and the code all messed up... well, that sucks so bad.
Good code must be easy to read. Developers are writers in some way.
Despite the fact that indenting with TABs is less disk consuming as well. -
crani8708y@gosubinit Visually it's the same and tabs/spaces is pretty low in my list of problematic styles clash and when reviewing someone else's code I never noticed if they were using tabs or spaces. You should try working with a dyslexic coder now that is a challenge.
In a big enterprise grade project you are probably looking at 10 mb of wasted space, 50 max, which is pretty negligible. If you are struggling with 50 mb in your git repo you need a bigger disk.
But hey, I love SV too and had quite the laugh at that rant but you are kinda missing the point, it wasn't about tabs vs spaces but about how petty programmers can be. -
@crani Have you ever needed to add code with TABs (let's say that's your style) to the parts of a space-indented "if" (or vice-versa)? Os something like that?
-
kamen69258yI'm a tabs guy. So much that I wrote myself a plugin that jumped through a number of consecutive spaces when hitting arrow left/right - at the last company I worked at the convention was spaces.
Can someone give me a legitimate reason for using spaces? The only reasonable one that I can think of is when using some sort of smart indent (that would result in e.g. one tab and three spaces in some scenarios). -
crani8708y@gosubinit Plenty of times, more than I probably realize tbh. Never had an issue with tabs or spaces, except for the few times I had to use Haskell.
-
4 spaces. That's it. You can't tab to indent when you're typing code in a <textarea>.
-
eybro5268y@bluesdriven
1. Why would you even think about coding in a textarea???
2. You could make a JS script to enable TAB indenting (or insert 4 spaces on tab click) -
@jonatan I'm thinking StackOverflow etc. I'm not actually opposed to any particular style of formatting, it's always going to be a subjective issue.
It's consistency.
Having files with mixed tabs, spaces, indentation, blank lines...
Related Rants
We might achieve world peace one day and still won't have agreed over indentation.
Indentation = TAB. Just 1 character (N spaces = N characters = more disk space, duh!). And then each dev can chose their own TAB width (in spaces) in their IDE of choice. Beautiful.
undefined
!!rant
rant
coding practices
space
tab
code style