Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Dylan16807
May 12, 2010

HardDisk posted:

4 spaces > tabs :c00lbert:

Indent one line with two tabs, then indent the next line with four spaces, a tab, and four more spaces.

Adbot
ADBOT LOVES YOU

qntm
Jun 17, 2009
The correct answer is "whatever my department standardises on".

E: Maybe that's why so many people found startups

1337JiveTurkey
Feb 17, 2005

The main point in favor of syntactically significant whitespace is that it stops these loving arguments.

Jeb Bush 2012
Apr 4, 2007

A mathematician, like a painter or poet, is a maker of patterns. If his patterns are more permanent than theirs, it is because they are made with ideas.

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.

ExcessBLarg!
Sep 1, 2001
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.

sarehu
Apr 20, 2007

(call/cc call/cc)
3 spaces is the best.

xzzy
Mar 5, 2009

I use a variable width font and hit the space bar until things sort of look lined up.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

sarehu posted:

3 spaces is the best.

:getout:

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

xzzy posted:

I use a variable width font and hit the space bar until things sort of look lined up.

msword user spotted

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Polio Vax Scene
Apr 5, 2009



Please tell me thats a .cpp file being fed into a web page

xzzy
Mar 5, 2009

I don't see the problem, the semicolons make it super clear where statements end.

Impotence
Nov 8, 2010
Lipstick Apathy

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.

Spatial
Nov 15, 2007

8dfa4fdaadf6 aggressively failed to get the joke and embarrassed myself biowarfware 06/05/2015

Impotence
Nov 8, 2010
Lipstick Apathy

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`"

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

ExcessBLarg! posted:

holy poo poo I don't care.

Space Kablooey
May 6, 2009


Spatial posted:

8dfa4fdaadf6 aggressively failed to get the joke and embarrassed myself biowarfware 06/05/2015

Who's 8dfa4fdaadf6? :confused:

Meat Beat Agent
Aug 5, 2007

felonious assault with a sproinging boner
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

Soricidus
Oct 21, 2010
freedom-hating statist shill

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?

Impotence
Nov 8, 2010
Lipstick Apathy

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

Soricidus
Oct 21, 2010
freedom-hating statist shill

Biowarfare posted:

whatever pyfmt gives i roll with

I tried it to find out

its output doesn't even comply with PEP8, lol

Joda
Apr 24, 2010

When I'm off, I just like to really let go and have fun, y'know?

Fun Shoe
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.

Coffee Mugshot
Jun 26, 2010

by Lowtax
lol if your language doesn't have a canonical source formatting tool

Impotence
Nov 8, 2010
Lipstick Apathy
python is my secondary language, my primary is PHP, which i've used since i was 5-6

FlapYoJacks
Feb 12, 2009
Look it, some programmers indent like THIS, some programmers indent like THAT.

Pavlov
Oct 21, 2012

I've long been fascinated with how the alt-right develops elaborate and obscure dog whistles to try to communicate their meaning without having to say it out loud
Stepan Andreyevich Bandera being the most prominent example of that

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

Impotence
Nov 8, 2010
Lipstick Apathy
var that = this; // just in case later
this = this.child[0]
this.yolo(that)

raminasi
Jan 25, 2005

a last drink with no ice
lol if your language even compiles source files with tab characters in them

Star War Sex Parrot
Oct 2, 2003

Zopotantor posted:

Amateurs.

IEEE 1164 posted:

The primary data type std_ulogic (standard unresolved logic) consists of nine character literals in the following order:

Character Value
'U' uninitialized
'X' strong drive, unknown logic value
'0' strong drive, logic zero
'1' strong drive, logic one
'Z' high impedance
'W' weak drive, unknown logic value
'L' weak drive, logic zero
'H' weak drive, logic one
'-' don't care

VHDL is a good and cool language.

WHERE MY HAT IS AT
Jan 7, 2011

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.

Space Kablooey
May 6, 2009




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

Kilson
Jan 16, 2003

I EAT LITTLE CHILDREN FOR BREAKFAST !!11!!1!!!!111!

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.

QuarkJets
Sep 8, 2008

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

QuarkJets
Sep 8, 2008

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

VikingofRock
Aug 24, 2008




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?

Linear Zoetrope
Nov 28, 2011

A hero must cook
I pay a guy to keep tabs on my spaces.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

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.

fritz
Jul 26, 2003


Amateurs.
[/quote]

quote:

Those that belong to the emperor
Embalmed ones
Those that are trained
Suckling pigs
Mermaids (or Sirens)
Fabulous ones
Stray dogs
Those that are included in this classification
Those that tremble as if they were mad
Innumerable ones
Those drawn with a very fine camel hair brush
Et cetera
Those that have just broken the flower vase
Those that, at a distance, resemble flies

Hughlander
May 11, 2005

QuarkJets posted:

Congratulations on reaching 2 years of PHP experience

PHP: So bad even a first grader knows to flee from it.

Adbot
ADBOT LOVES YOU

raminasi
Jan 25, 2005

a last drink with no ice

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.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply