What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 129 Stack Exchange communities.

The site can not accept an answer complaining about badly formatted code. I did all the 4 spaces thing, etc. And still after 3 hours the site did not accept my post.

Here is the copy of the answer I submitted initially: http://pastebin.com/P2HfWyCZ

Look, there is nothing strange about it, I used the {} at first, then switched to

<pre><code>

and nothing worked.

This is annoying and unnecessary. Why so much CARE about formatting code? Writing a "look here" + pastebin url seems like the most simple and workable approach, but defeats the purpose of stackoverflow

Oops! Your answer couldn't be submitted because:

Your post appears to contain code that is not properly formatted as code. Please indent all code by 4 spaces using the code toolbar button or the CTRL+K keyboard shortcut. For more editing help, click the [?] toolbar icon.

share|improve this question
5  
You're right, an external link is easier to browse and will last forever; moreover, code formatting is for loosers, a true programmer can read code even black on black. With its computer turned off. –  Damien Pirsy Nov 23 '11 at 12:48
10  
What happens when the code at pastebin disappears? Your answer becomes useless. –  ChrisF Nov 23 '11 at 12:50
5  
I edited your answer to clean it up a bit... Compare Your pastebin version with the version I clean up for you and tell me if you think it's better having the answer on the site, formatted nicely. Not trying to be a jerk, I'm trying to help you learn how to format posts for readability and therefore upvote goodness. –  The Unhandled Exception Nov 23 '11 at 12:54
    
I see, you edited everything that remotely looks like code. I take no offense, and I appreciate your help. I do prefer that all the contents be on stackoverflow, I just pointed out that it was quicker and less troublesome to use a pastebin url, as well as my frustration with the automated code checker behavior. –  RedComet Nov 23 '11 at 13:22
2  
FWIW, I wouldn't have upvoted your pastebin version. The edited version I probably would have. –  Yuck Nov 23 '11 at 13:26
    
I see, you edited everything that remotely looks like code. Well I tried to make anything that was code look like code. If I'm talking about someFunction() in a sentence I backtick it so it's clear that it's code and not English. I also personally backtick false and && and such, but that's personal preference. –  The Unhandled Exception Nov 23 '11 at 13:53
    
@TheUnhandledException: Nice try. But horizontal scrollbars are evil. I fixed it for you. –  Won't Nov 23 '11 at 16:04
    
@ಠ_ಠWon't Awesome, thanks. That's why I love this community, we all work to make the content better! –  The Unhandled Exception Nov 23 '11 at 17:03

3 Answers 3

up vote 15 down vote accepted

I'm guessing that the issue was because you mixed a lot of code with English. For example:


Remember this are bitfields and & is the "bit and" operator NOT the boolean && GDK_WINDOW_STATE_ICONIFIED =2 or 10 on binary and event->new_window_state is an int which second bit is active

A Widget can be both maximized AND minimized at the same time, GDK_WINDOW_STATE_MAXIMIZED = 4 or 100


If you use the backtick (`) around inline code, it improves readability:


Remember this are bitfields and & is the "bit and" operator not the boolean && GDK_WINDOW_STATE_ICONIFIED =2 or 10 on binary and event->new_window_state is an int which second bit is active

A Widget can be both maximized and minimized at the same time, GDK_WINDOW_STATE_MAXIMIZED = 4 or 100


I edited your answer to clean it up a bit... Compare Your pastebin version with the version I clean up for you and tell me if you think it's better having the answer on the site, formatted nicely.

This is annoying and unnecessary. Why so much CARE about formatting code? Writing a "look here" + pastebin url seems like the most simple and workable approach, but defeats the purpose of stackoverflow

I disagree completely. It's really not that hard to format code properly. I'm sorry you're frustrated, but linking to a site where someone has to go to review the code is not a better solution in any way.

What happens if the pastebin is deleted? Your answer becomes useless. What happens if you want to refer to the pastebin? I don't want to switch between tabs just to understand your answer. Also, doesn't it take more time to open pastebin, create a paste, and insert the link than it does to just paste code on So and click the "format as code" button?

I see no advantage to using pastebin. What I see is a new user who is frustrated... we're here to help! If you can learn how Markdown formatting works you'll get a lot more enjoyment out of StackExchange.

share|improve this answer
    
I did read the formatting help and faqs. And there was no warning that mixing regular text and programming symbols could lead to a problem. The editing box allows a button {} as well as the editor allows the <pre> tag leading the user to believe in its flexibility, it should be one or the other if strict formatting is so needed. I will not dig into if its is a ui design flaw or code flaw, but being a little more detailed on the help instructions about the strictness of the parser would really be helpful. –  RedComet Nov 23 '11 at 13:40
1  
I agree, it can be a little tricky to get up to snuff on how to use Markdown... You could ask a new question on meta asking for advice on how to make markdown more accessible to new users. Just be prepared for downvotes, people downvote on meta when they don't like the idea and there's a lot of people who downvote anything critical, LOL –  The Unhandled Exception Nov 23 '11 at 13:51

I was able to post the exact same answer provided in the pastebin into a new answer without any problems (10k+ only).

I've also edited your answer to include the correct version.

Why so much CARE about formatting code?

You must be new here...those filters originated out of necessity, not because some programmer felt funny. There are many quality filters at work in Stack Exchange, and every single one was introduced because it was needed.

Edit: On second thought, maybe it's a low-rep filter, which doesn't apply to me anymore.

share|improve this answer

Rules and filters aside, it probably is a good idea anyway to make your questions as easy to read (by anyone) as possible. Since we're all here on a voluntary basis, the easier it is for other users to understand your problem, the more likely they will be to help out.

It's not even a matter of whether they will be more inclined to help out; if someone looks at your question and can't understand it, she wouldn't be able to answer your question even if she wanted to.

Posting a pastebin URL is much easier... for the poster. For someone who wants to answer the question, however, it requires visiting another site, having to copy and paste code if she wishes to provide examples or to annotate problematic code, etc.

And leaving aside all of that, if someone is scanning the site for problems to solve, since there's no code in your question (or at least, there wasn't any in the original revision), it is much easier to overlook or misunderstand the issue.

share|improve this answer
1  
My first post on stackoverflow was an answer,not a question. My first question/complain, was the result of my frustration at trying to post an answer to someone else problem. A problem which people will face eventually. So I wanted to put it where everyone could access and benefit from it. Pastebin is simple, posting here should be even simpler, that was my point. Otherwise I would not bother to complain and leave things as they were. Thanks to my complain, I learned things that weren't in the docs of this site, and the answer was helpfully edited and included by Josh/The Unhandled Exception. –  RedComet Nov 24 '11 at 2:52
1  
Ah, nevermind; I misread your OP, and I think I then proceded to lecture you on something that is perfectly obvious to you. Sorry about that (: –  todofixthis Nov 24 '11 at 20:52

You must log in to answer this question.

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