39

I was reviewing edits. One was a bit tricky. OP had posted links to images of code. A user edited it so that the images was visible without clicking.

While this sure is a small improvement, I don't think it should be accepted anyway, because posting code as images is wrong in the first place.

However, I cannot choose a fitting reason for the reject. It's clearly not vandalism or spam. It does improve the post a little bit. It does not cause any harm, except maybe giving the impression that it's ok to post code as images. It does not conflict with author's intent, and it is not about irrelevant tags.

So what should I do in this situation? I would like to reject it with the motivation that the editor instead should ask OP to post the code as text.

18
  • 28
    I'd argue that it doesn't improve the post and reject it accordingly with a suitable comment.
    – Paulie_D
    Commented Nov 2, 2017 at 11:47
  • 5
    This is a perfect case to use the "Reject and Edit" button.
    – George
    Commented Nov 2, 2017 at 11:48
  • 21
    @George How do you suggest I edit it? I'm NOT prepared to convert an image to code.
    – klutt
    Commented Nov 2, 2017 at 11:50
  • 3
    @klutt If you're not prepared to do the work, just skip it. George is right, someone should reject it and just do the work. Unfortunately, these kinds of edits are annoying to do.
    – Erik A
    Commented Nov 2, 2017 at 12:00
  • 15
    It is a very common edit, no-rep users can't post images and have to fall back to posting a link. The implicit assumption is that the editor verified the image and found it appropriate to appear in the post. If he didn't get that right then just reject it, no biggie. And be sure to vote to close the question, it is off-topic without the code. Commented Nov 2, 2017 at 12:34
  • 6
    @ErikvonAsmuth doing the work for reviewer in this case is to go to the post out of queue and vote it down and close, optionally with comment explaining to author that they need to replace image with code. After that work is done the edit can be rejected (because that's the work that should have been done by suggestor instead of useless edit)
    – gnat
    Commented Nov 2, 2017 at 14:22
  • 1
    I noticed that many people have no idea how to copy text from Windows cmd.exe for error messages. Several times I had to provide links like some of the first Google hits of "copy text windows command prompt" (I don't use Windows myself). I find the error messages as important as the code. Especially for future visitors searching for the error message. Commented Nov 2, 2017 at 15:59
  • 6
    One of the main reasons that newbies can't inline images is to stop them posting images of text. So converting text image links to inline images is counter-productive. When I see such image links or inlined images I post this in a comment: Please see [Why may I not upload images of code on SO when asking a question?](http://meta.stackoverflow.com/questions/285551/why-may-i-not-upload-images-of-code-on-so-when-asking-a-question)
    – PM 2Ring
    Commented Nov 2, 2017 at 16:13
  • 3
    most of the time, the images are images of code that suck. Showing the code as image without link helps other downvoting & closing... It doesn't improve the question but it improves speed when closing (in case people would have visited the link) Commented Nov 2, 2017 at 16:32
  • @Jean-FrançoisFabre Fair point, although I'm sure plenty of people downvote as soon as they see a code image without even bothering to check how good or bad the code is.
    – PM 2Ring
    Commented Nov 2, 2017 at 16:32
  • @PM2Ring You have a pretty good argument there. It pretty much says it all.
    – klutt
    Commented Nov 2, 2017 at 17:30
  • 2
    in some rare cases, the code as image is useful (showing underlined errors or hints from the IDE), but the code as text must also be shown Commented Nov 2, 2017 at 19:30
  • If you have time, I would say Reject and Edit to edit so that the code gets formatted as text. If you do that, the rejection reason "didn't correct the critical issues with the post" would be suitable. If you don't have time, I would skip it and let someone else do the work. Commented Nov 4, 2017 at 14:10
  • 4
    wtf. Please do not reject and edit and convert the code from the image manually into text. That’s the job OP should do in order to improve their answer. If they can’t even do that, then I don’t think the question should be kept. Questions that only contain screenshots of code (regardless of whether they are inline or linked) are off-topic because they do not contain code to reproduce the problem. – Don’t waste your time to convert code to salvage such questions.
    – poke
    Commented Nov 4, 2017 at 22:18
  • @PM2Ring Which is not a problem if they retract the vote after (if) the problem is fixed.
    – user202729
    Commented Sep 29, 2018 at 10:53

2 Answers 2

43

That is a reason to reject. As was pointed out in the comments, inlining pictures of text suggests that pictures of text are OK. They are not.

  • You can use a custom Reject reason for this. Something like "Please don't inline images of code. The text is not indexed by search engines and cannot be used by screen readers."
    You could also link to this MSO discussion on discouraging images of code.

  • If you don't have the time for a custom Reject reason, just select "No improvement whatsoever". Inlining images of code is not an improvement.

The best thing to do is Reject & Edit, and copy the actual code into the post. However, this is encouraging a very lazy behaviour of the OP. Also, as SiHa points out in their comment, this has to be done very carefully, because any mistake in copying may hide the error in the code (or may introduce an error in answer).
I prefer to spend my time posting a comment, telling the OP to edit the code in their post themselves.

11
  • 10
    FWIW, I don't agree that Reject & Edit + Copy is a good idea. Apart from encouraging laziness, it's too easy to introduce typo's which could mask the real error. I just use the custom reject reason very similar to your first bullet (which I may plagiarise - the bit about screen readers is good).
    – SiHa
    Commented Nov 2, 2017 at 15:44
  • @SiHa Good point about masking the error! One does indeed have to be very careful when copying the code. I've added this in my answer. If one avoids masking the error, however, the benefit to the community is that there is now a post with code as text. Commented Nov 2, 2017 at 15:49
  • 3
    Agreed, but then we're back to encouraging laziness. It's not hard to include code (it's harder to take a screenshot, often). I feel, quite strongly, that it should be the OP that puts it there. That's why as well as the custom reject, I'll often open up the original question and leave a comment there as well.
    – SiHa
    Commented Nov 2, 2017 at 15:52
  • @SiHa I think it just comes down the the actual quality of the question, if it's a good question (apart from the code being in a picture) you should move the code inline with the question.
    – George
    Commented Nov 2, 2017 at 16:00
  • @George - if it were a good question otherwise, most likely, there wouldn't be an image of text. Anyway, we'll have to just disagree on this.
    – SiHa
    Commented Nov 2, 2017 at 16:02
  • 6
    @George I want to see code from the OP in a form that I can run and edit, preferably a MCVE. My code editor doesn't accept PNGs... If a new coder can't figure out how to post their code (and supporting text like sample data, expected output, and error messages) properly on SO they need to learn that skill.
    – PM 2Ring
    Commented Nov 2, 2017 at 16:19
  • 3
    Note that if image is actually useful to the question (e.g. bitmap showing rendering issue) edit converting link to image should be accepted (unlike screenshot of code which this question is concerned about). Commented Nov 2, 2017 at 18:00
  • 2
    "The best thing to do is Reject & Edit, and copy the actual code into the post." Are we legally allowed to do that? If the author of the code has not included the code itself as part of the question, they have not yet granted the right to use the code as part of the CC license (only the right to use the image of the code). I always insist that the OP themself add the code to the question.
    – YowE3K
    Commented Nov 2, 2017 at 20:24
  • 1
    @YowE3K Good point about the legal part... a question in its own right. Perhaps even for Law.SE rather than MSO. From a practical point, if they don't want the code out there, they shouldn't put it in a picture either. But the law might say something different. Commented Nov 2, 2017 at 20:27
  • 2
    @PM2Ring related
    – gnat
    Commented Nov 3, 2017 at 7:19
  • 2
    @gnat What a classic! :D
    – PM 2Ring
    Commented Nov 3, 2017 at 7:23
-11

There is a big difference between OP inlining their images and someone inlining them through an edit. Minor improvements are something we should approve, and seeing the code directly instead of having to click some link is an (minor) improvement.

A post is better if we see the image of its code instead of a link.

Keep in mind, that we are not speaking about posting the image in the first place. Everyone agrees that it should not be done. But the edit though, like other small improvements, should be approved.

9
  • 1
    It seems to be some different opinions. I'm gonna go by the opinion that it transforms it into a post that gives the impression that it is ok to post code in images, and thus it's a worse post than a post that does not. I'm gonna reject them.
    – klutt
    Commented Nov 4, 2017 at 14:14
  • You do as you will, of course. I am just putting out there that, haters gonna hate, ranters gonna rant and potatoes gonna potate, the post is still better with inline images of code than with links to images of code, if only because of one less indirection level ;) Commented Nov 4, 2017 at 14:15
  • 4
    I'd say it's better in one aspect and worse in another. But more importantly, worse on the whole. And as someone pointed out. The fact that you need 50 rep to post inline images is because of people posting code as images.
    – klutt
    Commented Nov 4, 2017 at 14:19
  • As a whole, I maintain that being able to spot right away typos in an image is better than having to click on it. Moreover, a lot of questions can be answered without having to actually run the code (copy pasting being the main argument against images of code) Commented Nov 4, 2017 at 14:22
  • True. I don't have any good source. I read it here: meta.stackoverflow.com/questions/358771/…
    – klutt
    Commented Nov 4, 2017 at 14:25
  • The post they link is advocating against images of code as a whole, and not about why low reputation accounts can't upload them. Theirs was a misleading claim. Commented Nov 4, 2017 at 14:31
  • I withdraw my claim, but I keep the opinion. :)
    – klutt
    Commented Nov 4, 2017 at 14:33
  • Fair enough, this belongs to you alone. Commented Nov 4, 2017 at 14:33
  • 2
    if you can spot typos, then the question is off-topic because of this very typo. Commented Sep 29, 2018 at 12:07

You must log in to answer this question.

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