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
The Cheshire Cat
Jun 10, 2008

Fun Shoe

I will happily make less money if it means I'm not a loving monster who uses spaces instead of tabs.

*edit* whoops, new page. Added a quote to the post.

Adbot
ADBOT LOVES YOU

Hyperlynx
Sep 13, 2015

The Cheshire Cat posted:

I will happily make less money if it means I'm not a loving monster who uses spaces instead of tabs.

*edit* whoops, new page. Added a quote to the post.

A space is always the same size. A tab is however many goddamn spaces a given dev's settings say it is. Try lining up statements that go over a line, using tabs, where everyone has a different tab width.

(you low-paid noob :smug:)

Slash
Apr 7, 2011

Hyperlynx posted:

A space is always the same size. A tab is however many goddamn spaces a given dev's settings say it is. Try lining up statements that go over a line, using tabs, where everyone has a different tab width.

(you low-paid noob :smug:)

Use an IDE which replaces tabs with spaces. That's what i do, saves on button presses.

Hyperlynx
Sep 13, 2015

Slash posted:

Use an IDE which replaces tabs with spaces. That's what i do, saves on button presses.

Right, but how many spaces have you set your IDE to replace the tabs with?

Unless it's exactly the same amount of spaces as whoever wrote the file used, it's going to look like poo poo.

cinci zoo sniper
Mar 15, 2013




Hyperlynx posted:

Right, but how many spaces have you set your IDE to replace the tabs with?

Unless it's exactly the same amount of spaces as whoever wrote the file used, it's going to look like poo poo.

I have mine set to 4 spaces, which is the convention for Python.

Bhodi
Dec 9, 2007

Oh, it's just a cat.
Pillbug
4 is the correct answer. I'll also accept 3

Hyperlynx
Sep 13, 2015

Ok. This is less obvious than I thought, for a throwaway joke, but I'll try explain it harder.

Here's formatted with spaces:
code:
void someFunction(int someParam,
                  int anotherParam,
                  int etc);
Here's trying to get the same formatting in Notepad on my system, with tabs and spaces. Apparently the tabs are set to 8 spaces wide:
code:
void someFunction(int someParam,
		  int anotherParam,
		  int etc);
I check my source into the repository, and you check it out. If you happen to have your tabs set to 4 spaces wide, it will instead look like this:
code:
void someFunction(int someParam,
          int anotherParam,
          int etc);
Conclusion: if you use tabs, you have no control over how the code is going to look in your reader's IDE. If they don't have the same tab setting as you, it's going to look weird. However if you use spaces you know it's going to look right because everybody uses monospaced font.

GenericOverusedName
Nov 24, 2009

KUVA TEAM EPIC
Quick, let's start a war about vim vs emacs now!

DACK FAYDEN
Feb 25, 2013

Bear Witness
Could this be skewed by those awful horrible no-good very-bad languages in which whitespace matters?

cinci zoo sniper
Mar 15, 2013




GenericOverusedName posted:

Quick, let's start a war about vim vs emacs now!
Like there's people to fight the war on the vim side, everyone has long since switched to nano.

No Safe Word
Feb 26, 2005

cinci zoo sniper posted:

Like there's people to fight the war on the vim side, everyone has long since switched to nano.

fight me :mad:


DACK FAYDEN posted:

Could this be skewed by those awful horrible no-good very-bad languages in which whitespace matters?
They actually break it down by language as well: https://stackoverflow.blog/2017/06/15/developers-use-spaces-make-money-use-tabs/

SupSuper
Apr 8, 2009

At the Heart of the city is an Alien horror, so vile and so powerful that not even death can claim it.

Hyperlynx posted:

Conclusion: if you use tabs, you have no control over how the code is going to look in your reader's IDE. If they don't have the same tab setting as you, it's going to look weird. However if you use spaces you know it's going to look right because everybody uses monospaced font.
Actually the conclusion is you should use both based on context instead of mindlessly applying a rule everywhere. Tabs provide customizable identation where it is flexible while spaces provide fixed spacing where it is strict. Everybody wins! :eng101:

Aleph Null
Jun 10, 2008

You look very stressed
Tortured By Flan

cinci zoo sniper posted:

Like there's people to fight the war on the vim side, everyone has long since switched to nano.

gedit - command-line is for old beards only.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon
I just set a tab to equal one space. Problem solved.

ikanreed
Sep 25, 2009

I honestly I have no idea who cannibal[SIC] is and I do not know why I should know.

syq dude, just syq!
Take tabs of acid and space out.

bookkeeper
Jul 14, 2010

it means "the kapital"

lifg posted:

I just set a tab to equal one space. Problem solved.

:stare:

the horror!

Forgall
Oct 16, 2012

by Azathoth

Regalingualius
Jan 7, 2012

We gazed into the eyes of madness... And all we found was horny.




No ring.

Dreddout
Oct 1, 2015

You must stay drunk on writing so reality cannot destroy you.
I think you'll find there are two rings in that image

Mr. Fix It
Oct 26, 2000

💀ayyy💀


SupSuper posted:

Actually the conclusion is you should use both based on context instead of mindlessly applying a rule everywhere. Tabs provide customizable identation where it is flexible while spaces provide fixed spacing where it is strict. Everybody wins! :eng101:

Yeah, tabs for indenting, spaces for alignment. Unless the style guide says spaces for indenting. Never use tabs for alignment. Also vim 4 lyfe.

To make this post thread appropriate


ToxicSlurpee
Nov 5, 2003

-=SEND HELP=-


Pillbug
Look at all you plebs using white space.

I program entirely in binary. :smaug:

Lottery of Babylon
Apr 25, 2012

STRAIGHT TROPIN'

Powered Descent
Jul 13, 2008

We haven't had that spirit here since 1969.

Mr. Fix It posted:

Yeah, tabs for indenting, spaces for alignment. Unless the style guide says spaces for indenting. Never use tabs for alignment. Also vim 4 lyfe.

To make this post thread appropriate




I'm fairly neutral on the tabs-vs-spaces issue, but I have strong opinions on the placement of curly braces.



Allman 4 lyfe

Stoatbringer
Sep 15, 2004

naw, you love it you little ho-bot :roboluv:

ToxicSlurpee posted:

I program entirely in binary. :smaug:

The trick is to simply get the 1s and 0s in the right order.

Also, Allman style.

cinci zoo sniper
Mar 15, 2013




Allman too, though K&R is tolerable.

Chitin
Apr 29, 2007

It is no sign of health to be well-adjusted to a profoundly sick society.

After that they could pop on down the corner and get some French ticklers.

Hyperlynx
Sep 13, 2015

We use GNU at work. I'm one of the two Windows devs in the office, and Visual Studio doesn't support GNU style, so I always have to fix the indenting manually :saddowns:

Talkie Toaster
Jan 23, 2006
May contain carcinogens

Powered Descent posted:

I'm fairly neutral on the tabs-vs-spaces issue, but I have strong opinions on the placement of curly braces.



Allman 4 lyfe

GNU is an absolute crime.

hooah
Feb 6, 2006
WTF?
Not as bad as Whitesmiths. Who the actual gently caress writes code that way??

Platystemon
Feb 13, 2012

as a person who never leaves my house i've done pretty well for myself.

ToxicSlurpee posted:

Look at all you plebs using white space.

I program entirely in binary. :smaug:

Real programmers set the universal constants at the start such that the universe evolves to contain the disk with the data they want.

Mr. Fix It
Oct 26, 2000

💀ayyy💀


cinci zoo sniper posted:

Allman too, though K&R is tolerable.

I probably default to K&R due to it being most prevalent in the stuff I work on, but Allman seems more "right" to me. gently caress all those other ones.

Warbird
May 23, 2012

America's Favorite Dumbass

Allman4lyfe

Also, real playas just throw poo poo in an editor and let Beautify do the work.

Absurd Alhazred
Mar 27, 2010

by Athanatos
Allman or bust.

Platystemon
Feb 13, 2012

as a person who never leaves my house i've done pretty well for myself.
Horstmann > K&R > Allman

Absurd Alhazred
Mar 27, 2010

by Athanatos

Platystemon posted:

Horstmann > K&R > Allman

BURN THIS HEATHEN!

Olive!
Mar 16, 2015

It's not a ghost, but probably a 'living corpse'. The 'living dead' with a hell of a lot of bloodlust...
Can we at least agree that Pico can go to hell

Platystemon
Feb 13, 2012

as a person who never leaves my house i've done pretty well for myself.

Olive Garden tonight! posted:

Can we at least agree that Pico can go to hell

It’s better than Whitesmiths or GNU.

Xun
Apr 25, 2010

Allman forever, K&R can suck it

Absurd Alhazred
Mar 27, 2010

by Athanatos

Xun posted:

Allman forever, K&R can suck it

R can't anymore. :rip:

Adbot
ADBOT LOVES YOU

Carbon dioxide
Oct 9, 2012

Hey folks, the programming forum is over thattaway ->

Content:

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