-9

Problem
I often have to rewrite questions/answers that I or other people have written because they are reformatted between being typed and them being posted on the site. I shall use "I" to mean "I or someone" from now on.

For example I write:

test1: 22ms test2: 23ms test3: 24ms

When I typed this I put return characters at the end of each line, so each test is on its own line. But Stack Exchange takes out these return characters squeezing my test results into a single horrible line, why?

Work Around
As stated within the Markdown editing help you can get true new lines by adding two spaces after the line:
test1: 22ms
test2: 23ms
test3: 24ms

My point isn't so much that you can't work around these issues but that Stack Exchange is creating poorly formatted questions by taking mildly badly formatted questions and converting them to very poorly formatted questions. Is this behaviour of not honouring single return characters beneficial elsewhere? Is there some advanced formatting that relies upon it?

Whitespace is one of the best ways to improve clarity.

12
  • 7
    Because using a code block is the correct way to format them. Or you can learn the details of Markdown and add two spaces at the end of a line to force a line break. Markdown is a standard that goes much farther than just Stack Overflow; GitHub uses it too, as do many other sites, for example. Commented May 2, 2013 at 8:33
  • 2
    Because StackExchange uses markdown for content entry, and that's just how markdown is.
    – JonW
    Commented May 2, 2013 at 8:35
  • I would just like to thank everyone for the -1s. Is my question badly phrased in some fashion or do you just disagree? Some comment on that would be helpful. It isn't a duplicate of meta.stackexchange.com/questions/22186/… as I’m asking why blank white spaces are removed, removing them in code is a minor additional point that seems to have been obsessed over. Possibly I've misunderstood what meta is for but having the tag "Feature Request" seems to suggest that questions of the form "Can the site stop doing x and start doing y" are acceptable Commented May 2, 2013 at 11:44
  • Yes, such questions are acceptable. However, voting on meta is different, the downvotes may simply mean "We want it to stay as it is". Commented May 2, 2013 at 12:42
  • 1
    @TinSoldiersAndNixonsComin' Ah fair enough, thank you TinSoldiers. I was beginning to get a little frustrated at the whole thing. Meta was seeming a lot less friendly than StackOverflow Commented May 2, 2013 at 12:46
  • @Richtea meta can be tough, yes. But not only downvotes flow more freely here, upvotes too, so you can usually compensate for your unloved feature requests easily by posting a helpful answer or two. Commented May 2, 2013 at 12:57
  • The downvotes here are also because you could find the answer very easily. There is big question mark on the top right of the text editor. It has link to advanced help and line breaks are clearly mentioned there. Commented May 28, 2013 at 11:58
  • 1
    @ShaWizDowArd This is the thing I found most frustrating about asking this question. People kept saying that you could get a new line by doing xyz. That wasn't my point (in fact I included a few work arounds in my question). My point was "This is an unnecessary hurdle, why is it here", no one ever answered why ignoring single return characters was a good thing. Is there an opposing case where ignoring single return characters improves a post? Or is necessary to use some advanced formatting? Commented May 28, 2013 at 12:05
  • In this case, I don't agree that adding two meager spaces after each line is "unnecessary hurdle". It's simple, it's part of markdown. I agree that -10 for first question isn't encouraging, but that's just the bitter truth about how Meta works. Commented May 28, 2013 at 12:08
  • 2
    @ShaWizDowArd No its not, however, looking up how to put in a new line is. The fact that it ends up being "put in two spaces" is irrelevant. Equally if all posts had to start with a $ that would be simple to do but would be stupid and unnecessary unless it had some good effect elsewhere. I'm still waiting on how this behaviour is ever good? If its never good then any extra complexity (however small) is unwarranted. (I'm prepared to accept that Stack exchange didn't make markdown, but people seem to be arguing that the current behaviour is a good thing) Commented May 28, 2013 at 12:15
  • 1
    @RichardTingle nobody said it's good. It's just how markup works. I do understand your frustration, but using markup is like learning new language at some level. Not trivial and require some time and effort but once you learn it, you know it. Commented May 28, 2013 at 12:20
  • The quoted duplicate isn't great, but this is a much better duplicate Commented Oct 12, 2013 at 11:41

2 Answers 2

3

On the opening point of "often hav[ing] to rewrite questions/answers", note the Preview feature on all StackExchange sites (not applicable to comments).

While StackExchange sites "raise the bar" on composing questions and answers (and comments, to a lesser degree), the articulated purpose is provide the facilities for better content.

It undoubtedly causes some initial difficulty (and even in the matter of LaTeX, ongoing difficulty!) for new community members. However this difficulty is mitigated by the ability of users, not just the original poster, to propose and approve edits.

Given the desire to maintain value in content over time, fighting link rot, etc., the editable nature of StackExchange more than justifies the use of Markdown (with local enhancements) to "lower the bar" relative to composing directly in HTML, while maintaining some advanced options for those so inclined.

Years back, before jumping into StackExchange communities, I had doubts about the viability of exposing so much functionality to users ... I clung to my ASCII art equations! But once I tried it, well, I can't go back!

2
  • 1
    I am aware of the preview feature. That is the point where I rewrite. Its more that people (myself included) often have to go in and edit other peoples posts which were well formatted in the text editor but in the markdown phase got shredded. So, is the "no single return character" useful in some fashion? If not my time and other peoples time is being wasted reformatting other peoples posts, whether the other people have read the docs is irrelevant, my time is wasted by making the edits. It probably adds up to hundreds of thousands of man hours so it better be useful elsewhere Commented May 2, 2013 at 11:50
  • That said this answer does answer the question as opposed to 'How can I work around the problem' so I'm accepting the answer Commented May 2, 2013 at 12:05
4

For your first "problem", see the help page linked from the editor and add two spaces at the end of each line:

test1: 22ms
test2: 23ms
test3: 24ms

For your second (click the "edit" link on this answer to see the "magic"):

public class class1{
    class1(){

    }
}
public class class2{
    class2(){

    }
}
8
  • 1
    yes there are work arounds, thats not really my point, my point is that there are unnecessary barriers to creating well formatted answers. What does stripping out single return characters achieve? If nothing then it shouldn't be in there, work around or not Commented May 2, 2013 at 8:44
  • 6
    Ever written HTML? You'll see the same behavior - you don't get a new paragraph without some markup. That's how this stuff works. That's how Markdown works and is documented. If you don't like it, propose an alternative editor/syntax/document format and explain why it's superior.
    – Mat
    Commented May 2, 2013 at 8:48
  • A little, although I'm more familiar with Latex which has similar behaviour. But thats not the point, they are obviously markup languages. Whereas the vast vast vast majority of users of the internet expect their posts to (language censor aside) go through unmodified by the site. My suggested behaviour is to use what all other forums (I know stackExchange is not a forum) use, tags to indicate code or special instructions, everything else goes through unchanged. I expect 90% of new users are suprised by the behaviour. Now if it's nessissary and well documented fair enough, but is it nessissary? Commented May 2, 2013 at 9:01
  • You need some form of syntax/conventions to enable advanced syntax. Markdown has very light-weight syntax to achieve this, lighter than stuff like [code] markers and such, so I'd argue it is easier to use than what you see on typical forums.
    – Mat
    Commented May 2, 2013 at 9:11
  • I suppose its a matter of opinion, I like self documenting "code", its easier to look up "How do I post code on stackoverflow" than it is to look up "How do I stop it doing this wierd thing". In fact I'd expect to have to look that up putting in code, but I wouldn't expect to look up "how do i put in new lines?". All this doesn't give a reason for removing return characters though (the ones in a list). I recognise you didn't write Markdown, but finding out why something does something seemingly crazy is half the battle to stopping being frustrated by it Commented May 2, 2013 at 9:21
  • No newlines are removed. They're stored as-is. And "disappear" when rendered in HTML. Unless you add Markdown formatting, which is mostly whitespace. Typing an extra "enter" isn't that surprising - you do that in word processors to get new paragraphs instead of line breaks (or whatever the correct typesetting terms are). I'm not saying Markdown is perfect, but it gets the job done with very, very little overhead in most circumstances.
    – Mat
    Commented May 2, 2013 at 9:26
  • 5
    @Richtea I'd probably stop using Stack Exchange sites permanently if they moved to a BB code editor like forums. I absolutely adore Markdown because it makes everything so much easier (once you're used to it), and any time I do find myself posting on a forum I generally stick to plain text because doing anything else is more hassle than it's worth. Commented May 2, 2013 at 10:11
  • @Richtea: Read meta.stackoverflow.com/editing-help and get over it.
    – Felix
    Commented May 2, 2013 at 10:56

Not the answer you're looking for? Browse other questions tagged .