Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

Sometimes I have seen questions with a ridiculous amount of trailing whitespace. This wouldn't bother me so much if the scrollbar wouldn't appear:

cout << "Hello World!" << endl;                                                                    

It might also be that the code is indented a lot and the trailing whitespace tips the scale:

 for(int i = 0; i < 10;i++)
          for(int j = 0; j < 10; j++)
                  thisVariableIWillIncrementAlsoILoveCamelcase += whyNotMultiply;      

It would be nice if when a language where whitespace doesn't matter is specified, trailing whitespace would be ignored.

share|improve this question
If a mechanism can detect that, then I'd rather see an automatic downvote instead! ;-) (Seriously: we need to teach folks to put some effort in their questions.) – Arjan Dec 5 '11 at 13:15
What languages require egregious amounts of whitespace tacked on at the end of a line??? I mean, other than the Whitespace language. – Won't Dec 5 '11 at 14:32
@Won't: Well, none that I know of, but it would be kind of wrong to mess with the whitespace if whitespace is meaningfull in the language. For instance if I posted some code, didn't mark it as any particular language and the question is something like "Why does my machine make a weird grinding noise when I try to parse this with obseleteParserâ„¢?" It just might be the case that the whitespace is significant, but when the prettifier thinks it is C++, it should be safe. In the rare (I haven't seen a single case of this yet) case where it is significant one can always add "language: lang-none". – HaskellElephant Dec 5 '11 at 14:45
In addition of the automatic removal of trailing whitespace, I would also like to see the automatic removal of empty lines (when there is a block larger than one present) – Veger Dec 20 '12 at 12:18
<irony>I have an almost overwhelming urge to remove the unnecessary whitespace in this question</irony> – ZombieSheep Dec 20 '12 at 12:21
If you wanted any proof that this happens, here is a recent one: – HaskellElephant Jul 2 '13 at 14:10

You must log in to answer this question.

Browse other questions tagged .