|
HardDisk posted:4 spaces > tabs Indent one line with two tabs, then indent the next line with four spaces, a tab, and four more spaces.
|
# ? May 6, 2015 20:09 |
|
|
# ? May 17, 2024 01:31 |
|
The correct answer is "whatever my department standardises on". E: Maybe that's why so many people found startups
|
# ? May 6, 2015 20:30 |
|
The main point in favor of syntactically significant whitespace is that it stops these loving arguments.
|
# ? May 6, 2015 20:41 |
|
1337JiveTurkey posted:The main point in favor of syntactically significant whitespace is that it stops these loving arguments. The main point of the last few posts before yours is that it doesn't.
|
# ? May 6, 2015 20:52 |
|
C'mon everyone knows how this plays out. Tabs are great, right? As long as you use tabs for indentation and spaces for alignment, then tabs merely represent indentation levels and everyone can set the tab stop in their editor to their preferred number of spaces-per-indent and everything just works great. Except, as soon as more than one person contributes to the project, someone will goof and end up mixing tabs and spaces for indentation, such that source files will only appear to have consistent indentation for one tab stop value (and you have to guess what that is). Worse, as soon as more than two people contribute to the project, you have people mixing tabs and spaces for indentation such that source files won't have consistent indentation under any one tab stop value. And it really is inevitable, given that "opportunistically convert runs of spaces to tabs" is a default-enabled option in some popular text editors. The only people who avoid this problem are those who have push hooks set on their repos to reject commits with mixed indentation. Or, (more likely) people who have never worked with 1-2+ others on a project. So the inevitable answer is N spaces, where N itself is determined through silly arguments and holy poo poo I don't care.
|
# ? May 6, 2015 20:58 |
|
3 spaces is the best.
|
# ? May 6, 2015 21:24 |
|
I use a variable width font and hit the space bar until things sort of look lined up.
|
# ? May 6, 2015 21:26 |
|
sarehu posted:3 spaces is the best.
|
# ? May 6, 2015 21:30 |
|
xzzy posted:I use a variable width font and hit the space bar until things sort of look lined up. msword user spotted
|
# ? May 6, 2015 21:54 |
|
|
# ? May 6, 2015 21:57 |
Please tell me thats a .cpp file being fed into a web page
|
|
# ? May 6, 2015 21:58 |
|
I don't see the problem, the semicolons make it super clear where statements end.
|
# ? May 6, 2015 22:01 |
|
Soricidus posted:Oh cool, how do you prefer to do your braces and indentation for multiline dict/set literals and comprehensions? I do it in whatever the gently caress I feel like, usually tabs. Then I run the python equivalent of gofmt to make it conform to PEP8 and commit.
|
# ? May 6, 2015 22:01 |
|
8dfa4fdaadf6 aggressively failed to get the joke and embarrassed myself biowarfware 06/05/2015
|
# ? May 6, 2015 22:36 |
|
Spatial posted:8dfa4fdaadf6 aggressively failed to get the joke and embarrassed myself biowarfware 06/05/2015 git commit -am "`curl -s http://whatthecommit.com/index.txt`"
|
# ? May 6, 2015 22:49 |
|
ExcessBLarg! posted:holy poo poo I don't care.
|
# ? May 6, 2015 23:02 |
|
Spatial posted:8dfa4fdaadf6 aggressively failed to get the joke and embarrassed myself biowarfware 06/05/2015 Who's 8dfa4fdaadf6?
|
# ? May 6, 2015 23:14 |
|
I do all my indentation by putting flush-left /**/ comments to the left of the actual code and then typing an appropriate number of words in them
|
# ? May 6, 2015 23:14 |
|
Biowarfare posted:I do it in whatever the gently caress I feel like, usually tabs. Then I run the python equivalent of gofmt to make it conform to PEP8 and commit. cool, did you notice how the thing you quoted was a thing that PEP8 fails to specify though and just lists a bunch of different options because nobody, not even the python maintainers, can agree on brace placement and indentation?
|
# ? May 6, 2015 23:18 |
|
Soricidus posted:cool, did you notice how the thing you quoted was a thing that PEP8 fails to specify though and just lists a bunch of different options because nobody, not even the python maintainers, can agree on brace placement and indentation? whatever pyfmt gives i roll with
|
# ? May 6, 2015 23:26 |
|
Biowarfare posted:whatever pyfmt gives i roll with I tried it to find out its output doesn't even comply with PEP8, lol
|
# ? May 6, 2015 23:37 |
Spaces are real nice when you're in school and need code snippets in reports, since the verbatim environment in Latex recognises tabs as single spaces. That said, I don't care enough to use anything but the tab button when coding and if the IDE automatically puts in 4 spaces or whatever, that's a nice bonus if it's for school.
|
|
# ? May 6, 2015 23:38 |
|
lol if your language doesn't have a canonical source formatting tool
|
# ? May 6, 2015 23:44 |
|
python is my secondary language, my primary is PHP, which i've used since i was 5-6
|
# ? May 6, 2015 23:48 |
|
Look it, some programmers indent like THIS, some programmers indent like THAT.
|
# ? May 7, 2015 00:13 |
|
ratbert90 posted:Look it, some programmers indent like THIS, some programmers indent like THAT. "Nothing exists which is not 'that', nothing exists which is not 'this'." -Zhuang Zi, on the proper indentation of source code
|
# ? May 7, 2015 00:22 |
|
var that = this; // just in case later this = this.child[0] this.yolo(that)
|
# ? May 7, 2015 01:14 |
|
lol if your language even compiles source files with tab characters in them
|
# ? May 7, 2015 02:53 |
|
Zopotantor posted:Amateurs.
|
# ? May 7, 2015 02:57 |
|
sarehu posted:Opening brace wastefully on its own line, lack of trailing comma on last enum entry resulting in spurious diff lines? Terrible. Look what you have wrought, I hope you're happy with yourself.
|
# ? May 7, 2015 03:00 |
|
Biowarfare posted:git commit -am "`curl -s http://whatthecommit.com/index.txt`" http://whatthecommit.com/index.txt posted:Your commit is writing checks your merge can't cash. Why is this one so funny holy poo poo
|
# ? May 7, 2015 03:55 |
|
ExcessBLarg! posted:And it really is inevitable, given that "opportunistically convert runs of spaces to tabs" is a default-enabled option in some popular text editors. In my experience it's the opposite, where the default settings seem to more often be to use spaces instead of tabs (which is the worst possible thing anyone could do!). Of course it leads to people committing files with mixed tabs and spaces for indentation, because they can't be troubled to do it properly or at least make it consistently wrong.
|
# ? May 7, 2015 05:42 |
|
Biowarfare posted:python is my secondary language, my primary is PHP, which i've used since i was 5-6 Congratulations on reaching 2 years of PHP experience
|
# ? May 7, 2015 08:27 |
|
The pro-est maintainers force all tabs to be expanded into spaces because mixed indentation is the most retarded thing ever, followed closely by tabs
|
# ? May 7, 2015 08:29 |
GrumpyDoctor posted:lol if your language even compiles source files with tab characters in them Are there actually languages/compilers which don't accept tabs?
|
|
# ? May 7, 2015 08:31 |
|
I pay a guy to keep tabs on my spaces.
|
# ? May 7, 2015 08:32 |
|
Dessert Rose posted:*huff, puff* Is this where the indentation and braces style debate is happening? I'm not late, am I? Heh, yeah, people brought it up ironically and are ironically debating it.
|
# ? May 7, 2015 08:44 |
|
Amateurs. [/quote] quote:Those that belong to the emperor
|
# ? May 7, 2015 13:08 |
|
QuarkJets posted:Congratulations on reaching 2 years of PHP experience PHP: So bad even a first grader knows to flee from it.
|
# ? May 7, 2015 14:40 |
|
|
# ? May 17, 2024 01:31 |
|
VikingofRock posted:Are there actually languages/compilers which don't accept tabs? F#, unless you enable them with a special compiler directive. F#'s semantic whitespace does not gently caress around.
|
# ? May 7, 2015 17:07 |