this post was submitted on 28 Feb 2024
913 points (96.9% liked)

Programmer Humor

32410 readers
1 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] Dirk@lemmy.ml 70 points 2 years ago (4 children)

Python: So you used spaces and tabs for indentation? NOW DIE!

[–] WhiteHawk@lemmy.world 43 points 2 years ago (2 children)

Mixing spaces and tabs should be a warcrime.

[–] pingveno@lemmy.ml 9 points 2 years ago

And in Python, it's merely a SyntaxCrime.

[–] merc@sh.itjust.works 0 points 2 years ago (1 children)

Find me anyone who claims they use tabs for indentation, and I bet I'll find at least one case where they're using both tabs and spaces.

The only safe way to avoid war crimes is to avoid tabs.

[–] dotMonkey@lemmy.world -1 points 2 years ago

I use the tab key but I'm pretty sure vs code converts that to spaces

[–] xigoi@lemmy.sdf.org 21 points 2 years ago (2 children)

Good. Spaces and tabs for indentation should never be mixed in any language other than Whitespace.

[–] Faresh@lemmy.ml 4 points 2 years ago* (last edited 2 years ago) (1 children)

Some people use tabs for indentation and spaces for alignment. It kind of gets the pros of tabs (user configurable indent-width) and the pros of spaces (alignment). That doesn't work in Python where you can't align stuff and the interpreter doesn't allow mixing tabs with spaces, but in other languages it is a possible style.

[–] BeardedGingerWonder@feddit.uk 0 points 2 years ago

There are no pros to tabs. Configure tabs to a number of spaces.

[–] Dirk@lemmy.ml 3 points 2 years ago

Raw adjust with tabs, fine adjust with spaces.

Don't laugh, people are actually doing that.

[–] malle_yeno@pawb.social 5 points 2 years ago

Mixing tabs and white spaces in 2024 is categorically a you problem lmao

[–] brettvitaz@programming.dev 4 points 2 years ago