this post was submitted on 25 Oct 2026
371 points (95.1% liked)

Programmer Humor

33823 readers
2008 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 3 years ago
MODERATORS
 

Mine is that the useState hook is an actual plague on the entire React ecosystem. Regardless of your opinions of React, if you wanna use something then use it right.

you are viewing a single comment's thread
view the rest of the comments
[–] frisbird@lemmy.ml 78 points 3 days ago (5 children)

Tabs are better than spaces

[–] Quetzalcutlass@lemmy.world 21 points 3 days ago* (last edited 3 days ago) (5 children)

Want to know something horrendous? Odin, my current favorite language, recommends mixing tabs and spaces in their style guide.

What's worse, their justification actually makes sense.

[–] LeapSecond@lemmy.zip 14 points 3 days ago

Another unpopular opinion: this alignment style looks terrible and wastes space. If you want alignment just start the parameters in a new line.

[–] Archr@lemmy.world 13 points 3 days ago

Fuck... They are right. This makes a lot of sense.

Now I have to share this with everyone at work.

[–] Orygin@sh.itjust.works 3 points 2 days ago

That's how it's always supposed to be. Tabs for indent, spaces for alignment. Languages that do not support this are trash

[–] GroundedGator@lemmy.world 2 points 2 days ago

I used to do this and it absolutely makes sense. However, I've shifted to tabs only and have removed the need for alignment with newlines.

[–] MarauderIIC@lemmy.zip 4 points 3 days ago

Does that rule have autoformatting support? If not it's a time waster anytime the parameters get refactored. I'm firmly in the camp of "machines do my formatting"

[–] danhab99@programming.dev 22 points 3 days ago (3 children)

Tab chars are better than spaces AND the correct tab width is 2 spaces

[–] eatham@aussie.zone 18 points 3 days ago (1 children)

Tab chars are better, no opinion on the width but if you use the chars, everyone can do what they want

[–] Zarobi@aussie.zone 2 points 3 days ago

I don't see why an IDE can't convert e.g. 4 width spaces to 50% visual width for those that prefer 2 spaces. That way the code doesn't need changing, and everyone still enjoys their own personal width preferences

[–] glibg10b@lemmy.zip 6 points 3 days ago* (last edited 3 days ago)

I use 8-wide tabs. I also keep lines under 80 characters

No, I don't use Java. How did you know?

[–] Humanius@lemmy.world 3 points 3 days ago (2 children)

I was on board with the first guy, but this is going too far. We should compromise between the 2- and 4-spaces camp, and we settle on 3 spaces.

[–] VigorouSchematic@fedinsfw.app 4 points 3 days ago

Lets make it incremental instead: 1 space for first ident, 2 space for second, 3 space for third... 🙃

[–] MicKet@swiss.social 1 points 3 days ago* (last edited 3 days ago)

@Humanius @danhab99
Formating is so 1990.
Modern would be to store Program code as database. Formating and UX of program code would be separated and an IDE would show Program code in the user preferred way.
But every Developer: "Hey modern way to store structured Data, you are wrong for my Work."

#structureddata #developer #conservatives #notonmywatch #codeformatting

[–] goatinspace@feddit.org 17 points 3 days ago (3 children)

Imagine a programming language not compiling because of spaces.

[–] xigoi@lemmy.sdf.org 1 points 1 day ago* (last edited 1 day ago) (1 children)

Such as C?

intmain(){return0;}
[–] goatinspace@feddit.org 1 points 1 day ago
#include <stdio.h>
int main(){printf("Replaced_square bracket_with_curly_brace_and added_2_spaces_4_u");return 0;}
[–] SparroHawc@piefed.world 5 points 3 days ago (1 children)

Isn't that Python's whole paradigm?

[–] JesusTheCarpenter@feddit.uk 2 points 3 days ago

That's the joke.

[–] Ephera@lemmy.ml 5 points 3 days ago

Not quite a programming language, but Makefiles have to be indented with tabs...

[–] PattyMcB@lemmy.world 8 points 3 days ago (1 children)

Ooh... good one, but any good IDE and/or source control will convert tabs to spaces anyway.

[–] frisbird@lemmy.ml 13 points 3 days ago

Any good IDE and source control should convert spaces to tabs. QED

[–] Equinox1289@sh.itjust.works 1 points 2 days ago (1 children)

I think text editors should handle it and convert between the two when convenient.

[–] frisbird@lemmy.ml 1 points 2 days ago* (last edited 2 days ago)

LOL, like a bytecode? write once, read whicheverway