question

Matt Whitfield avatar image
Matt Whitfield asked

[meta]Is code formatting really that hard?

I don't know the internals of StackExchange, but is there any way that we can emphasize to people 'click the code button'? Or maybe get people to actually look at the post they've just posted and then think 'Oh my that's a complete mess let me see what I can do about it'?

I mean, I know it's meant to be collaboratively edited and everything, but it just seems a bit boring for people (mostly Kev) to have to go into every question and format people's code...

Any thoughts?

meta-asksscformatting
2 comments
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Agree! Whilst I can read every new question, it's not too much of an issue, but when (not if) the number of questions posted grows, there's no way anybody could keep up.
0 Likes 0 ·
I agree too. I would be more than happy to edit any code I see but unfortunately I am nowhere near the required number of points.
0 Likes 0 ·
Fatherjack avatar image
Fatherjack answered

I agree too. I was looking yesterday and I think I get to edit posts in a little while (rep > 2000) so will try to help out where I can. From my experience, I cant see the question building under the text box as its off the bottom of the screen so maybe (new) users are unaware of fact that its not formatted clearly??

Also, there is a rep level that you have to achieve before you can edit your own questions so new users cant fix the problem once its posted, even if they do notice it. Can the rep levels be altered, is there a config/settings option for the site?

10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Brimstedt avatar image
Brimstedt answered

It's a bit embarrasing, but the first answer I wrote here (unlike all things ive written on stackoverflow) i managed to forget this and didnt even look at my post afterwards.

I was surprised to find out that it was the formatting of the entry that had been edited, when i later checked the changes...

I think that people do not look at the preview simply because when you start typing its below the screen area. If editing and preview was side by side, i think it'd be better, but perhaps hard on non widescreens.

One solution could be to have a step between "Post your answer" and the actual posting, where you see only the preview - but personally I dont like such solutions as i find it ineffective.

1 comment
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

I agree that the two-phase commit approach detracts from the process. And for most offenders I don't think it would matter anyway, just slow everyone else down :)
0 Likes 0 ·
Grant Fritchey avatar image
Grant Fritchey answered

I think it's just the nature of things. Over on the main SSC site people regularly post dumps of code that are unformatted and a mess. Frequently the people doing this are inexpereinced at SQL Server and at these news groups. Almost as frequently, it does seem like they're not the sort of people who read and follow directions well, or they wouldn't be posting questions that are easily answered in Books Online. This leads to the mess we get. It's just how it's going to be.

2 comments
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

To corrupt a cliché... there are two kinds of people: those who hot-key BOL and those who just went "what's BOL?"
0 Likes 0 ·
I think this is a common problem on many sites/forums. Maybe somebody could create the conscience dba to help out with the code button :)
0 Likes 0 ·
Blackhawk-17 avatar image
Blackhawk-17 answered

I haven't been keeping score or anything like that but I would imagine that it is generally a person's first post that would have the issue. PITA yeah, but also excusable somewhat. In many cases these individuals are in a hurry as there is an issue that needs to be resolved and, at the time, reaching out trumps prettiness.

As time goes on however the tolerance is reduced.

Perhaps if the system sent an email to the post orignator after every edit performed by others with a brief Editor FAQ and links it may subtely drive the point home without detracting from the on-line user experience.

It may also help if the preview area was labelled as such and had a note similar to:
"Please ensure that you have formatted your post for legibility"

1 comment
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

+1 - I like the "you are old enough to do that better" type of process
0 Likes 0 ·
Ian Roke avatar image
Ian Roke answered

What I didn't realise until today is how easy it is to format code on here. I was pasting my code in and then going down each line and entering four spaces!

All you really have to do for starters is paste your code in and then highlight it and click the code button which is even easier! :-D

3 comments
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

+1 - every day is a learning day!! ;)
0 Likes 0 ·
Ha ha I'm so thick sometimes! :-D
0 Likes 0 ·
This was something that i too had to figure out. I am used to clicking the code button and then pasting the code. Pasting, highlighting then clicking does make it very easy.
0 Likes 0 ·
Jeff Moden avatar image
Jeff Moden answered
Where is this magical "Code Button"? I'm not seeing it anywhere on the display even as I type this message. I've also checked the FAQ and I'm not seeing any formatting instructions. IIRC, there used to be such instructions in the FAQ. Where are the formatting instructions for this site and where is the magical "Code Button" everyone keeps talking about? Thanks for the help.
2 comments
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

It's in the tool bar above the answer window. Fifth from the left: Bold, Italic, Hyperlink, Quote, **Code**, Picture, Attachment, etc... It has the 101010 icon which may not be the best visual clue. Like you, I thought there was a link to how to format answers at one time. It probably looked a bit like the guide on stack overflow :) - http://stackoverflow.com/editing-help
0 Likes 0 ·
Thanks, Ken. I guess it really is time for me to retire my 11 year old 32 bit machine. The toolbar wasn't showing up on that machine. It does show up on my newer machine. Thanks for your time.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.