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
-
Only people using vim or notepad have this problem.
Any half-baked IDE will indent automatically. -
@OMGitsOLE First of all, not all IDEs do. In my experience it's actually most of the older ones. Secondly, just because most people in the world runs Windows that doesn't mean it's a superior OS. The same goes with default preferences in IDEs
-
@Monk and then all the project files only look nice in IDEs. Right? Because other text editors have their own understanding of tab length. Cat'ing files to terminal is also not considered
-
This is such a formatting partisan debate. We should combine tabs and spaces. The new character should be called spabs. It will be a compromise between space supporters and the dumb fucks that support tabs.
-
@Demolishun goddamn that is an absolutely perfect use of the Picard four lights thing.
-
I don't get it. I was always taught to set my editor so that tab key creates 4 spaces. Is this wrong, and why if so?
-
sirjofri5195yIndentation is a personal preference. So if you indent with spaces, other users feel uncomfortable reading your code. Indent with tabs and the personal editor of the reader will display it correctly.
Alignment is for readability of similar lines following each other. You can use it perfectly for aligning the equal signs of variable assignments. You can assume that devs use monospace font, so aligning those things with spaces is totally fine and it's displayed correctly in all editors (using monospace fonts) -
sirjofri5195y@lkjhgf253 I wouldn't say it's "wrong". Also companies have their own guidelines, so better use that at work (and if they use spaces, well, use spaces, too. Remember it's about readability)
-
@epse First image I found. Aligning function arguments for example. That won't show equally for someone with a tab size of 2 vs 4
-
epse36615y@ScriptCoded I think that image doesn't get the point of a tabstop? A tab character isn't a constant width, but it aligns the next character to the next column of the width that you set your tab widt to
-
@epse Yeah, that isn't the best image. Just wanted to show what I meant by formatting. Ignore the tab marks :)
Who the hell thought that spaces OR tabs for indentation was an option?
For Spaghetti Monster's sake. An space is to separate words, one at a time. Tabs are for indents.
PERIOD
.
rant