0

This question already has an answer here:

For a site that is so much about code and programming, why does it not have much, much better tools built in for managing blocks of code?

I spend a LOT of time on Stack Overflow answering a lot of questions for several years now. I'm not a newbie. I deal mostly with answers which means I copy blocks of code from the question, then set out to write an answer. Also, I fix the formatting of hundreds of posts. With such a large portion of what Stack Overflow does having to do with blocks of code, I'm very surprised that the editing capabilities for dealing with blocks of code are so rudimentary.

Even having JUST the ability to do block indents or outdents of a selected block of code would make a HUGE difference. The only place in my entire programming experience where I have to manually paste in blocks of four spaces on multiple lines in a row just to add an if statement before a block of code is here on Stack Overflow. It also leads to great inefficiencies trying to fix people's poorly formatted questions just so they are legible to the community.

In addition, one of the common goofs for newbies on the site is that they paste in completely illegible code because it is not obvious how to format code for this site.

Yes, I know the most efficient way to do things is to to copy something out to my favorite editor, fix it and paste it back in, but seriously - why are we being forced to use those extra steps? Is a block indent/block outdent really more than a few lines of code? Obviously, the editor could go much further than that, but I'm wondering why even the most basic steps have been avoided?

FYI, this post (and related feature request) is a bigger discussion of the missing indent feature though it still doesn't explain why this is being ignored by the site owners which is really what I am trying to ask.

marked as duplicate by random Mar 1 '14 at 1:26

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.

  • 3
    Illegible code being pasted in is very frequently an actual cause of problems. Code formatting should be left to actual code editors. The last thing we need is more people trying to format code that's broken because of bad formatting to begin with... – Charles Mar 1 '14 at 1:08
  • 2
    What's complicated about pasting your code from your favorite editor as is, selecting it and pressing the code formatting button (or its hotkey ctrl k)? – 3ventic Mar 1 '14 at 1:08
  • While that's definitely not complicated, I'm not sure that's 100% obvious. – Qantas 94 Heavy Mar 1 '14 at 1:17
  • Have you tried this userscript? – Antony Mar 1 '14 at 1:19
  • @3ventic - I deal mostly with answers which means I copy blocks of code from the question, then set out to write an answer. What you're saying is that the editor in StackOverflow should not be used for composing code. In a site pretty dedicated to discussing code, that just seems dumb and backwards. Of course, I could NEVER use the StackOverflow editor, but that seems like we're talking about the 1980's and my question is why such simple and highly useful capabilities have NEVER been added. – jfriend00 Mar 1 '14 at 1:26
  • @Antony - my question is as much about all the people who post questions with horribly formatted code (I mostly post answers). No userscript is going to reach most of the people who post questions. – jfriend00 Mar 1 '14 at 1:27
  • @Charles - and I'm arguing that like or not, the StackOverflow question and answer editor is being used thousands of times a day to edit code. The readability of the code on StackOverflow and the efficiency of answer questions would be improved a lot if it had better code editing capabilities. I'm not asking for rich capabilities. I'm just asking for simple basics like the ability to block indent/outsdent a selection. – jfriend00 Mar 1 '14 at 1:29
  • @random - I added notes to the end of my question about why I don't think this is a duplicate of the one you've marked it a dup of. That other post doesn't have any answers that answer this question. – jfriend00 Mar 1 '14 at 6:36
  • 1
    I don't understand; this really does read like you're arguing in favour of having line indents as part of the editor (which I would quite like) but you seem adamant that's not what you want. What are you requesting? – Richard Tingle Mar 1 '14 at 8:37
  • P.sP.s. With feature requests answers aren't necessarily taken into account. If we have one feature request requesting free unicorns which recieves no answers and another asking for the same thing it is still a diplicate. It is useful to collect all the votes in favour/against together – Richard Tingle Mar 1 '14 at 8:44
  • @RichardTingle - So, what am I supposed to do to register my interest in better code formatting support in the stackoverflow editor? Posting this seemed to be counter-productive. It was my first foray into a feature request to try to improve the site and I feel as though I got my hand slapped with zero guidance as to what I could have done that would have been more useful. – jfriend00 Mar 1 '14 at 8:49
  • @RichardTingle - my question asks why this obviously deficient feature has been ignored for so long? I half expected the answer to be people pointing me to features that were there that I just didn't know about, but that appears to not be the case. Now, I'm just dumbfounded that the tools in such an obviously useful and important area have been ignored for so long and I'm wondering why? Yes, I want the features improved, but this question is more about why the site owners have ignored this? – jfriend00 Mar 1 '14 at 8:51
  • Presumably you couldn't find the dupe so it was difficult to find. This post will draw more attention to the duplicate now and in the future; the same way duplicates are helpful in stack overflow itself. And vote up the duplicate. If it gets enough support it may be implemented – Richard Tingle Mar 1 '14 at 8:51
  • 1
    @jfriend00: Remember that Stack Exchange is larger than just Stack Overflow (a bike maintenance site doesn't need code editing) and that Stack Exchange is not being developed by a democratically elected group of developers. We get to make suggestions and community voting is helpful and appreciated but votes do guarantee something will happen. One if the things I like about the SE stack is the razorsharp focus on a limited feature set and a clear vision of what the sites should be about. A minimalist editor is part of that focus and vision, and I for one, can live with that just fine. – Martijn Pieters Mar 1 '14 at 9:19
  • 1
    @random - what's the point of posting the link to that question? Do you think this question is some how related to that one? FYI, changed question from feature-request to discussion. – jfriend00 Mar 1 '14 at 17:43

Browse other questions tagged .