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

Possible Duplicate:
Automatic code reindent button

I often see questions with a lot of messy code thrown in. It's hard and unpleasant to dig it, and sometimes even hard to even understand what is done there.

Is this a good idea to make "Prettify code" button in the editing interface which inserts/removes line breaks and do the proper indentation?

share|improve this question

marked as duplicate by Arjan, Bo Persson, animuson, jmort253, hims056 Dec 18 '12 at 4:23

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

9  
It would be nice, but what would the options be? How would the "language" be determined? Whose style guide should be used? –  Oded Dec 17 '12 at 18:20
5  
Most decent IDE's have this capability and most users already have an IDE that is better suited to the languages that they use and therefore interact with on the site. Implementing this for "all" languages on the site would be quite an undertaking... –  Lix Dec 17 '12 at 18:36
add comment

2 Answers

I don't think this would solve the underlying problem, which is that some people (thankfully relatively few) do not put as much effort as they could/should into writing their questions. Even if the code were auto-formatted nicely (which would be quite a challenge to do in such a way as to please everybody), it wouldn't fix the rest of the rambling, typo-strewn, unfocused content. (So maybe we need a 'prettify post' button that gets rid of personal complaints, extra punctuation, and fixes word choice, spelling, etc. :) )

For people who want to ask a good question or give a good answer, the burden of code formatting is very small compared to coming up with a good post.

In some ways, it's actually helpful to see a poorly formatted post. If the asker is unwilling to put forth the effort to format it reasonably, it's a good indication that the question is not worth your time.

share|improve this answer
1  
Almost in agreement, except that new users frequently misunderstand the formatting options available in the editor, and new programmers (and hobbyists) often don't yet even recognize the importance of code formatting and indentation at all. –  meta.michael Dec 17 '12 at 18:59
    
So it is worth my time to help them improve their question, if it turns them into a valuable contributor somewhere down the line, and helps them improve their own coding practices. –  meta.michael Dec 17 '12 at 19:00
add comment

I use this script to have tab indent instead of moving focus and i really like it to indent code well ( and other users are not confused )

share|improve this answer
add comment

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