You are viewing a single thread.
View all comments View context
47 points

Mixing spaces and tabs should be a warcrime.

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
*

Why would I use spaces if I use tabs?

To comply with Python’s best practices:

https://peps.python.org/pep-0008/

Also, if you work on the Linux Kernel, you’ll see a mix of tabs and spaces:

https://elixir.bootlin.com/linux/latest/source/block/bfq-iosched.c#L390

Also, it seemd like a huge waste of time hitting the space bar so many times…

You use an editor that doesn’t auto-indent?

permalink
report
parent
reply
1 point
Deleted by creator
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
2 points

That’s a setting in the editor.

permalink
report
parent
reply
4 points

I    don’t    use    an    ide,    but    I    wrote    a    script    that    replaces    any    space    I    type    with    four.

I    haven’t    worked    out    all    the    use    cases    yet,    though.

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
4 points

Depends on your settings, but yeah typically it does

permalink
report
parent
reply
3 points
*
1 point
permalink
report
parent
reply
9 points

And in Python, it’s merely a SyntaxCrime.

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