5

I've seen quite a few posts that have bad code formatting because of using tabs.

Right now, only the MCVE page has a note that says: don't use tabs. Why not add it to the Editing Help page as well? After all, the Editing Help page is the most likely place a user looks for help when having formatting problems, because there is a link to it when asking a new question.

9
  • 2
    Personally I'm surprised that phrasing hasn't sparked more tabs-vs-spaces flame wars here yet.
    – BoltClock Mod
    Commented May 15, 2014 at 1:56
  • 1
    Why? Tabs work fine.
    – bjb568
    Commented May 15, 2014 at 2:21
  • Here's the a post on formatting sandbox.
    – bjb568
    Commented May 15, 2014 at 2:30
  • @bjb568 They don't work inline (if you're typing in the answer/question box), correct? Or maybe it's just because I'm on a PC... :P
    – hichris123
    Commented May 15, 2014 at 2:31
  • No, they don't work inline, but you aren't supposed to edit code inline. Copy-paste it.
    – bjb568
    Commented May 15, 2014 at 2:32
  • On the python tag, at least, tabs are tantamount to kicking a puppy.
    – roippi
    Commented May 15, 2014 at 4:14
  • @bjb568 The problem with copy-pasted code is that SO's tab stops are often different from the poster's editor. SO uses 8-column tabs, many programmers use 4-column tabs, so things don't line up correctly.
    – Barmar
    Commented May 16, 2014 at 21:11
  • @Barmar Unless spaces and tabs are mixed, that shouldn't be a problem. It can be fixed with CSS tab-size: 4.
    – bjb568
    Commented May 16, 2014 at 22:17
  • 3
    The problem is that spaces and tabs often ARE mixed. I have to fix these things up all the time. They usually have other bad indentation, so I just copy it all to Emacs, re-indent it (with no tabs), and paste it back.
    – Barmar
    Commented May 16, 2014 at 22:22

0

You must log in to answer this question.

Browse other questions tagged .