Whenever I see a poorly formatted post (might be a question or an answer) or completely non-formatted code, I use an online tool such as Instant SQL Formatter to format the code, and then I edit the post to make the necessary changes.

Mostly, I answer to questions tagged with oracle tag. Believe it or not, I have had to edit the post(especially questions)' almost 99% of the time before answering. Any SQL or PL/SQL code which is not formatted makes it difficult to read, understand, and answer.

My concern is, whether it is considered a good practice to use third party tools to edit and format a poorly formatted code? Or, does this site recommend a better way to do it?

What I think?

I am unaware of a feature in this beautiful site, which would allow me to format code posted by a user while asking a question or answering. It will save my time to visit the third party site to use their service just to do the formatting bit.

  • I also tend to do this when I run into horrifyingly-formatted code (mostly XML/JSON or SQL) that would be too difficult to clean up by hand. I don't see anything wrong with it. – senshin Apr 8 '15 at 15:14
  • @senshin Thanks – Lalit Kumar B Apr 8 '15 at 16:36
  • 1
    Why wouldn't it be??? – user1228 Apr 8 '15 at 18:50

Yes, I don't see anything wrong with it. I've used outside tools when formatting code before, including that link you provided, as well as Format Text as Table, a text editor, or even SSMS, depending on what's handy. It think it's easier and quicker to the code outside of the post editor and just copy it back in.

The only thing I'd say is to not go looking to make all these code formatting changes. If you come across something that needs to be edited, then edit it. Please don't go on an edit spree looking for things to format. Also, be mindful that you might need to do minor improvements to how it was formatted. For example, I tend to remove the horizontal scroll because it can be a pain to view code with the scroll.

  • Thanks for the answer. I see we are almost on the same page, however, it becomes really necessary sometimes to edit a SQL or PL/SQL code because OP either used block quotes or just posted the code without formatting.I am really tensed sometimes(seldom though) to edit and fix the formatting of code. – Lalit Kumar B Apr 8 '15 at 15:27
  • @LalitKumarB As I said, editing the code to improve it is totally acceptable. Just don't actively search for posts to be edited. If you find one that needs editing, then feel free to edit away. – Taryn Apr 8 '15 at 15:29

You must log in to answer this question.

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