this post was submitted on 28 Feb 2024
633 points (97.2% liked)

Programmer Humor

19593 readers
783 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] mindbleach@sh.itjust.works 32 points 8 months ago (2 children)

Tabs exist specifically for spacing out stops. They're viewer-configurable, avoiding holy wars about 4 or 8 or that one idiot suggesting 3.

I do not give a shit if your seventeen-argument function has the overflow variables line up exactly with the paren. Just put them one step further in.

[–] mindbleach@sh.itjust.works 14 points 8 months ago (1 children)

I just remembered the dumbest argument I've ever suffered about this - someone insisting the "length" of one tab changed, depending on what's before it. As in, is it eight spaces, or seven? Or six! It only goes up to eight spaces! No. It goes one stop. The same way a newline goes one line, and cannot by measured by how many times you'd slap the spacebar to get text to wrap around to the next line.

[–] kogasa@programming.dev 1 points 8 months ago (1 children)

Err, why would there ever be something besides a tab before a tab? Are we doing ASCII art?

[–] dan@upvote.au 3 points 8 months ago* (last edited 8 months ago) (1 children)

They mean if you insert a tab after some other text.

Word processors and desktop publishing apps tend to have tab stops (sometimes visible in a ruler at the top of the page) and pressing tab goes to the next tab stop. They're about an inch apart (assuming letter or A4 paper) by default, and you can usually also add your own tab stops. For example, you might have text like this:

Hi
Hello

Assuming the next tab stop is to the right of both words, pressing tab at the end of each one would actually bring you to the same indentation level:

Hi      |
Hello   |

Text editors and IDEs don't do that, and instead make all tabs the same size regardless of where they are.

Some people want the word processor implementation in text editors though. The comment you replied to is saying that's dumb, and I agree with them.

[–] kogasa@programming.dev 1 points 8 months ago

I understand... In a programming environment 99.999% of tabs aren't after any other text.

[–] pohart@programming.dev 1 points 8 months ago

Your ide should align things how you configure them to be aligned. Nothing says all my tabs need to be the same length.