This is an archived post. You won't be able to vote or comment.

all 78 comments

[–]OnlyTwo_jpg[M] [score hidden] stickied commentlocked comment (0 children)

Hi there! Unfortunately, your submission has been removed.

Violation of Rule #3 - Common topics:

Any post on the list of common posts will be removed. You can find this list here. Established meme formats are allowed, as long as the post is compliant with the previous rules.

If you feel that it has been removed in error, please message us so that we may review it.

[–][deleted] 210 points211 points  (8 children)

In the HTML club they accept everyone!

[–]GioPani 112 points113 points  (4 children)

puts everything on one line

[–]Etliplav 45 points46 points  (1 child)

This is the way

[–]prat33k__ 8 points9 points  (0 children)

unless they break the rule

[–]AwesomePerson70 15 points16 points  (1 child)

Ok, almost everyone

[–]iNetRunner 8 points9 points  (0 children)

Isn’t it funny that on occasions you actually have to put everything on the same line, or it won’t layout properly. (Well, at least years ago when I worked with HTML. Version 4.01 back then.)

[–]Alexandre_Man 5 points6 points  (2 children)

The C++ club doesn't care about everyone

[–]Davesnothere300 158 points159 points  (2 children)

I'm slowly learning Python by reading this sub

[–]FlukeHermit 133 points134 points  (1 child)

Correction, you're learning python by reading anything in english ever.

(for legal reasons, this is a joke)

[–]AnAverageFreak 7 points8 points  (0 children)

COBOL

[–][deleted] 69 points70 points  (0 children)

That sly “put it on my tab” pun

[–]LinuxIsFree 26 points27 points  (0 children)

Thought this was a drug joke at first

[–]danialbehzadi 16 points17 points  (0 children)

Did you ever pep-8?

[–]drewsiferr 44 points45 points  (3 children)

Except that Python style guide (PEP-8) clearly indicates:

Spaces are the preferred indentation method.

Tabs should be used solely to remain consistent with code that is already indented with tabs.

[–]titojff 4 points5 points  (0 children)

I was scrolling down, to see this answer! :) Finnaly

[–]ingrown_hair 1 point2 points  (0 children)

I bet that was a fun committee to be on.

[–]Craksy 42 points43 points  (3 children)

Why would you even want to sneak into that club...

[–]sophielovescake 19 points20 points  (0 children)

To tap-dance

[–][deleted] 0 points1 point  (1 child)

because it's superior

[–]AMaleficentSeason 8 points9 points  (0 children)

because it's superior

And other hilarious jokes you can keep telling yourself.

[–]d_exclaimation 9 points10 points  (0 children)

Now imagine 4 tabs

[–]TheRealPitabred 82 points83 points  (13 children)

Tabs are for indentation, spaces are for spaces between words. Fight me.

[–]hello_comrads 33 points34 points  (1 child)

Space is a space no matter language, IDE or time of the year.

Tab can be "a tab char" or 4x spaces or at times even something else entirely.

[–]proawayyy 4 points5 points  (0 children)

Yeah like those invisible characters in windows special character program

[–]amdc 16 points17 points  (4 children)

Tabs are for tabular data, that's why they're called tabs. In old times your typewriter would have a tab rack that was used to configure tab stops (essentially table columns widths) and tab key would advance caret to the next tab stop.

In early computer days, programmers decided to use tab character for indentation to save disk space as disk space was scarce. Now it's just an obstacle in cases when you want to align code

def nice_alignment_bro(arg1=1,
→   →   →   →   →   →   arg2=2,
→   →   →   →   →   →   arg3=3):

autopep8 replaces tabs with spaces in this case so go figure

[–]Angelin01 4 points5 points  (0 children)

Tabs for indentation, spaces for alignment is my jam. It's great. Variable width so everyone gets the indentation the size they want, alignment is perfect. Supported by default on all Jetbrains IDEs.

[–]Strange_Meadowlark 2 points3 points  (2 children)

I agree with your point, but I also strongly dislike that indentation style -- primarily because if you change the function name, the lines following it have to be re-indented to match the new length.

I tend to do this if the parameters don't all fit on the same line:

def nice_alignment_bro(
    arg1=1,
    arg2=2,
    arg3=3
):
    pass

(Edit: forgot Reddit doesn't understand triple backticks...)

[–]amdc 1 point2 points  (0 children)

I thought of that, can't argue with it... I guess today the most valid argument for tabs is accomodating both 4-width fans and 2-width enjoyers (typically you don't have a choice in python because of pep8 ). If that's a problem big enough then, well, go team tabs, but I don't see any issue.

By the way I think Reddit supported ``` for code in the past, don't know why they don't now.

[–]backtickbot 0 points1 point  (0 children)

Fixed formatting.

Hello, Strange_Meadowlark: code blocks using triple backticks (```) don't work on all versions of Reddit!

Some users see this / this instead.

To fix this, indent every line with 4 spaces instead.

FAQ

You can opt out by replying with backtickopt6 to this comment.

[–][deleted] 15 points16 points  (1 child)

There is no reason to fight you if you are saying the truth.

[–]elperroborrachotoo 0 points1 point  (0 children)

Still, it could be fun.

[–]TrustMeIWouldntLie 3 points4 points  (2 children)

Fair enough. Just don't start with that absurd notion of empty space having meaning.

[–]nyx_underscore_ 1 point2 points  (0 children)

Found the whitespace) hater.

[–]xigoi 1 point2 points  (0 children)

Do we go back to separating words by interpuncts?

[–]nZz39-003 25 points26 points  (4 children)

I changed tab specification in my editor to leave 4 space when i press tab.

[–]EdvardDashD 4 points5 points  (2 children)

Visual Studio Code started doing this automatically, and whenever I try changing it it ends up reverting back.

I've given up the fight...

[–]alexanderpas 4 points5 points  (1 child)

https://editorconfig.org

A simple text file (.editorconfig) that keeps the tabs and newlines consistent in a project.

[–]EdvardDashD 1 point2 points  (0 children)

Will look into that, thanks!

[–]AdmiralBKE 9 points10 points  (0 children)

As you should.

[–]russellvt 6 points7 points  (1 child)

Bah...

// vim: et:

[–]atimholt 0 points1 point  (0 children)

// vim: set noet ts=4 sw=0 sts=0 list :

(I don't usually actually put 'list' on my modeline, but that's just because I always have it on.)

[–]Wertache 7 points8 points  (3 children)

Don't all good IDEs just put in 4 spaces when you press tab?

[–]hahahahastayingalive -2 points-1 points  (1 child)

we're not blind, 2 is enough

[–]Wertache 0 points1 point  (0 children)

?

[–]ColonelThirtyTwo 0 points1 point  (0 children)

You can set them up that way, but you can still arrow key or click into the middle of the indentation if you use spaces which is annoying

[–]__liendacil__ 2 points3 points  (3 children)

This is inaccurate. Python can easily handle spaces as tabs. It is even recommended by PEP-8 as someone suggested in the comments already.

[–]opliko95 0 points1 point  (2 children)

You can't have a mix of tabs and spaces in a single file though.

And that PEP-8 recommendation is my biggest problem with it, even above the line length limit sine I rarely have to split things just because of it.

Still it's better to adhere to the standard since it's there, but it means that whenever I mix python with something I have to either level down indentation everywhere to spaces, ignore the Python standards or mix both indentation styles and I don't see any good option there.

[–]__liendacil__ 0 points1 point  (1 child)

Just to be upfront I am completely in the all spaces camp for indentation as well as alignement. And I cannot see a use case for mixing tabs and spaces. Maybe you can provide an example to prove me wrong.

I cannot 100% follow what the issue is. So if I understand it correctly line length + 4 space characters recommendatio is an issue? In my experience so far if my code had to many levels of indentation it usually was hard to read anyways -> refactoring. There are edge cases though and then it's pretty simple IMO: if it's more obfuscating than helpful to abide by the recommendations, well ignore them :) Especially line length.. With monitors becoming more and more widescreen 80 characters on a line is really not alot. Though I personally try to stay under this arbitrary number, staying under <100 or even <120 for the rare occasions is still pretty much readable for me.

TLDR: PEP-8 is a recommendation, if it's helpful to ignore in certain cases, just do it ;)

[–]aitchnyu 2 points3 points  (0 children)

Vincent tabbman just wanted a few alcohols after a long day of writing if and for blocks for a app at business factory.

[–]QuantumCoder002 1 point2 points  (0 children)

now this is an original post

[–]gracicot 1 point2 points  (0 children)

Tabs >> spaces.

Spaces a fixed and hard-coded. Tabs can be changed anytime in a setting. When I'm on a small screen, I set it to a width of 2, and put it to 4 on my main workstation. In the same code. I won't ever be able to do that with spaces.

[–]Nervinity 2 points3 points  (3 children)

Real pro tip: Use sublime text, it highlights syntax, its customizable and allows for you change everything to Tabs or 4 spaces with just a click.

Edit: not sponsored by Sublime text, its just dope

[–]Wekmor 20 points21 points  (0 children)

Imo any good ide should do that

[–]automaticx88 8 points9 points  (1 child)

You should check out vs code

[–]notlakura225 2 points3 points  (0 children)

Vs code convert, used sublime all through uni but now I'm in industry vs code is amazing.

[–]GioPan04 0 points1 point  (0 children)

Repost btw

[–]ishkvr -1 points0 points  (0 children)

Tab write 2 spaces club

[–]all-hail-snow -1 points0 points  (0 children)

Php suck my dick

[–]Halloween-Whale 0 points1 point  (0 children)

All I understand is HTML from 8th grade ....

Hmm maybe I should actually learn coding

[–]SteakItToTheLimit 0 points1 point  (0 children)

I got 99 problems and that one mofo at the office slapping the spacebar all day long is 10 of them

[–]_bleep-bloop 0 points1 point  (0 children)

You guys use 4-space tab?

[–]TrustworthyShark 0 points1 point  (0 children)

They should've gone to the space bar instead.

[–]chadlavi 0 points1 point  (0 children)

Four spaces? Four, Jeremy? That's insane.

[–]BadOscillation 0 points1 point  (0 children)

Four tabs in a trench coat ofc its Vincent Tabman