You are viewing a single thread.
View all comments
77 points

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

permalink
report
reply
47 points

Mixing spaces and tabs should be a warcrime.

permalink
report
parent
reply
9 points

And in Python, it’s merely a SyntaxCrime.

permalink
report
parent
reply
-5 points

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.

permalink
report
parent
reply
7 points

Why would I use spaces if I use tabs? Also, it seemd like a huge waste of time hitting the space bar so many times…

permalink
report
parent
reply
7 points

Don’t IDEs just replace any tab with 4 spaces anyways? Pretty sure VSCode does

permalink
report
parent
reply
7 points

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

permalink
report
parent
reply
3 points
*
22 points

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

permalink
report
parent
reply
4 points
*

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.

permalink
report
parent
reply
-1 points

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

permalink
report
parent
reply
3 points

Raw adjust with tabs, fine adjust with spaces.

Don’t laugh, people are actually doing that.

permalink
report
parent
reply
5 points

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

permalink
report
parent
reply
4 points

Are you ok?

permalink
report
parent
reply

Programmer Humor

!programmerhumor@lemmy.ml

Create post

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

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.

Community stats

  • 6.9K

    Monthly active users

  • 1.4K

    Posts

  • 32K

    Comments