24

I haven't been approving edits for long, but I frequently see edits to questions/answers that look something like this:

enter image description here

The best I can tell is that this means they deleted the white space on the left from the question. However, I'm not sure if this is an "improvement", as it doesn't fundamentally change the answer other than a very miniscule formatting change. I'm only familiar with the R coding language, so I don't know if these kinds of formats are useful in others, but my gut feeling is no.

So to summarize, what should one do in this situation? Approve the edit or reject for no improvement?

25
  • 20
    The suggested edit does also explicitly specify Kotlin as the language for syntax highlighting (not that it necessarily matters in this case since it's already highlighted with the correct language). I would recommend the "Side-by-side Markdown" view in cases like this one, it's often much more clear about what changes are being made by the suggested edit.
    – Henry Ecker Mod
    Jan 22, 2023 at 3:37
  • 46
    "I'm not sure if this is an "improvement"" you think the answer with the wrong indentation (to the left) is in no way worse than the one with the correct intendation (to the right)?
    – VLAZ
    Jan 22, 2023 at 8:38
  • 3
    This is why I asked because I'm not sure if that is an incorrect assumption to make for other programs/languages. Jan 22, 2023 at 8:55
  • 50
    In most languages, and all reasonable languages, indentation doesn't matter. But that doesn't mean that reducing the indentation is not an improvement. It can mean the difference between readable code that fits on your monitor and unreadable code that doesn't. Only in languages where indentation is significant do you need to worry about such edits being potentially harmful. Jan 22, 2023 at 9:54
  • 6
    It looks more like yet another scheme to get reputation points with the least amount of work by doing formatting changes only (now that pure formatting changes to single words in the main text are probably not that effective any more(?)). There is much more to do: For example, missing articles, run-on sentence, and the Indianism "next" (it should be "following" (in that context)) Jan 22, 2023 at 19:33
  • 45
    @CodyGray I'm offended that you consider Python to be unreasonable. Jan 22, 2023 at 20:05
  • 4
    I'm clearly in the minority, but I would reject the proposed edit in your question which does nothing but tweak the indentation. All cosmetic edits improve a post, but if they don't make any significant improvement in the legibility or understanding of the question (or answer) then they are not really worth the effort. For those wanting to make SO a better place, I think there are far more useful ways to spend time, though I suspect some edits of this kind are made by those chasing internet points, and minor reformatting of code is low hanging fruit.
    – skomisa
    Jan 23, 2023 at 6:18
  • 7
    @skomisa When I need to scroll left and right to read, I wish to find something more readable (answer on this or other website). I made few edits like this, it was not just identation (if I remember well), but it was main reason because code was far to right, and it was giving me a headache while reading. Someone who is trying to get reputation can also add "the" multiple times. Jan 23, 2023 at 14:54
  • 2
    I personally approve these edits as they improve the readability of the post, unless the language requires indentation in it's syntax e.g. python so I reject those for the OP to update, however I do ALWAYS reject edits that do nothing other than adding the language for the code highlighting Jan 23, 2023 at 15:28
  • 10
    @WhatsThePoint Why would you reject edits that add the language for syntax highlighting? Those are unambiguously helpful.
    – endolith
    Jan 23, 2023 at 16:56
  • 1
    @endolith not always. Adding the language is only helpful if it fixes the syntax highlighting. If there is no or there can be no problem with the highlighting, then such edits serve no useful purpose to the site. Question tagged with exactly one tag that has a syntax hint (most programming languages: [c++], [python] - check the bottom of the info to see the enabled syntax hint) then all code blocks in the question would use that hint. However, if more than one tag with a hint is used, or a code block for a different language shows up, then the syntax highlighting can be off.
    – VLAZ
    Jan 23, 2023 at 17:02
  • 7
    If a question has two such tags, then the highlighter enters "fun mode". Or the slightly longer name is "make best guess for the language but use completely arbitrary rules what "best" is, such that a question tagged [html] [javascript] might recognise some code as LISP of all things".
    – VLAZ
    Jan 23, 2023 at 17:04
  • 4
    @MaximilianBurszley users with less than 2k rep do, when their suggested edit is approved
    – Kevin B
    Jan 23, 2023 at 21:08
  • 5
    @WhatsThePoint Syntax highlighting isn't pointless decoration; it aids readability of the code. Adding the language of the code is a clear improvement and should be accepted.
    – endolith
    Jan 23, 2023 at 21:47
  • 4
    @WhatsThePoint It's not about "needing" it, it is about making it easier and therefore faster to parse. That's just how our brain works.
    – paleonix
    Jan 24, 2023 at 11:01

4 Answers 4

120

While proper indentation can be somewhat opinionated, we generally accept (and should accept) edits to indentation that:

  • everyone would agree with (i.e., in braced languages, making the lines within a scope line up rather than being arbitrarily spaced all over the place) or which improve conformance to an accepted community standard (e.g. PEP 8, for Python)

  • specifically for questions, do not mask an error (whether syntactic or logical) caused by indentation, in languages where indentation is syntactically significant. (The question might be about that error!) Only fix this if it's clear from context what the indentation should be and that the issue is known not to be caused by that indentation (i.e., OP made a typo when reproducing the code for Stack Overflow, but has correct indentation locally).

Making code more readable is improving it. 12 spaces of indentation would be considered excessive by almost anyone, and the existing code used only 4 for the next level anyway. The code went from having inconsistent indentation, to having clearly defined levels of indentation each represented by the same amount of indentation (4 spaces, in this case). I think that's unarguably an improvement.

23
  • 4
    Yes, reducing indentation from 12 spaces to 4 is "unarguably an improvement", but it is also arguably such a minor improvement that it is a waste of time and effort. The code with 12 spaces might be jarring for some, but I really don't think it has any effect on being able to read and understand the code. I'm all for including such cosmetic edits when bundled with other substantive and worthwhile edits, but trivial cosmetic edits on their own just waste the time of reviewers.
    – skomisa
    Jan 23, 2023 at 7:17
  • 2
    @skomisa as it happens, I've already shared thoughts on that topic: meta.stackoverflow.com/a/420357/523612 Jan 23, 2023 at 13:27
  • 3
    @skomisa, I'd suggest, its up to the reviewer to say if the edit is an improvement and up to the editor to decide if it is worth the effort.
    – Jodrell
    Jan 23, 2023 at 16:38
  • 6
    @Jodrell adding to that: after the edit has already been suggested and you already took the time to look at it, the effort of all parties is already spent. Even if you see that an edit is very low impact, that doesn't provide any rationale for why rejecting it is better than accepting it. Jan 23, 2023 at 19:22
  • 2
    @Jodrell That sounds noble, but resolves nothing. This question has highlighted that SO documentation contains conflicting statements on what constitutes a worthwhile edit. Mealy mouthed statements in the documentation such as "Even small changes can be good edits!" are counterproductive; they tell the reader nothing of value. SO should provide more definitive guidelines, and a bunch of examples of worthwhile/worthless edits would be very helpful. (By analogy, I found the Unfriendly/Friendly examples for the Code of Conduct to be very useful.)
    – skomisa
    Jan 23, 2023 at 19:23
  • 1
    @skomisa eh, i'm not so sure that it's SE's place to decide how the community edits. Different communities have different needs. SO is much bigger than the rest, and as such we need to take care to make sure we aren't filling the queue/taking up all reviewer bandwidth with needless edits. Smaller communites don't really have this problem.
    – Kevin B
    Jan 23, 2023 at 19:27
  • 3
    @HymnsForDisco Re "why rejecting it is better than accepting it", the reason is to not reward bad behavior. Accepting such edits is only encouraging future trivial edits to be submitted. I'm not saying that editors are necessarily acting in bad faith, and the SO documentation on editing certainly needs improvement, but trivial edits which make no significant improvement overall have a negative effect on the SO community.
    – skomisa
    Jan 23, 2023 at 20:12
  • 2
    The only negative impact they have is on the ability of low rep users submitting more edits due to the archaic pipeline from suggested edit -> review queue. Once we have a better way of giving users the privilage to edit without suggesting edits this problem will go away. We shouldn't punish users because SO hasn't fixed their system yet.
    – Kevin B
    Jan 23, 2023 at 20:16
  • 1
    @KevinB You (deliberately?) missed my point. I carefully provided the caveat "By analogy" because my point was nothing to do with following/adopting SE guidelines at all, but that their Code of Conduct did something very helpful: it provided concrete examples. The SO documentation for edits would be greatly improved if there were examples of good and bad edits. It is easy to support opposing positions on edits purely by cherry picking contradictory quotes from the SO documentation and other Meta posts. It's obvious that greater clarity is needed. And again, knock off the strawman argument.
    – skomisa
    Jan 24, 2023 at 3:08
  • 2
    @skomisa I'm simply explaning how the help center works. outside of very few locations, it can't contain such samples. Otherwise we'd have no need for an on meta FAQ.
    – Kevin B
    Jan 24, 2023 at 15:07
  • 2
    @skomisa "but it is also arguably such a minor improvement that it is a waste of time and effort" - that would be an argument for not making the edit to begin with. But when the edit has already been put in the suggestion queue, the effort is already unavoidable so you might as well just roll with it. Probably something you "reject and edit" of course.
    – Gimby
    Jan 25, 2023 at 12:54
  • 1
    @Gimby I advocate in my other linked answer for "Improve edit" instead. Rather than bikeshedding, "just rolling with it" entails - in my view - building upon the other minor improvement. After all, you'd want to make it yourself, as part of your own edit, if you consciously chose between making it and not making it, right? Because it still is an improvement, i.e., better than nothing? Jan 25, 2023 at 14:31
  • 2
    "but of course there are no points on offer over there" - to be quite frank, the reputation system is so poorly thought out that I instinctively dismiss any policy argument based on "but someone might get the wrong number of points". Jan 25, 2023 at 18:43
  • 1
    Good luck with that. First you'd need to get people to agree on things. For one example, and as you may have noticed, I don't particularly agree with your position. Jan 25, 2023 at 21:10
  • 1
    @skomisa except... they do... unless they want to have their own employees do the reviewing.
    – Kevin B
    Jan 25, 2023 at 22:53
25

I believe it’s correct and necessary to fix code formatting to make things readable. In this example, it may not make a huge difference as the lines of code is very small but we should be consistent in correcting the code formatting.

In this review, one has correctly made the changes as it’s always 4 spaces on the left after the curly bracket in Java by default in any IDE (at least that’s what the language looks like).

17

Specifically addressing the criteria you appear to be using:

However, I'm not sure if this is an "improvement", as it doesn't fundamentally change the answer other than a very miniscule formatting change.

Read the How do I use the Suggested edits queue? help article:

Common reasons to Approve

  • Improves grammar, spelling, or formatting of the post, or fixes other minor mistakes

Common reasons to Reject

  • Clearly conflicts with author’s intent
    • changes a post to say the opposite, or something very different from what the original post read.

And from the Learn more pop-up in the suggested edits queue page

How to work through this queue:

  • Edits should maintain the post author’s original intent.
  • Even small changes can be good edits! Choose Improve edit if a post could use more changes.

In summary, the official guidance is pretty clear that small improvements of formatting are encouraged, and edits that "fundamentally change the answer" (in the literal meaning of that word) should be rejected.

26
  • 5
    That article you link to also cites under Common reasons to Reject : "changes to content or formatting that are unnecessary". I'd argue that the specific edit proposed in the OP was "unnecessary" because the code was perfectly legible and understandable before the edit. Also, just because "small changes can be good edits", it doesn't follow that the specific change mentioned in the OP was a good edit.
    – skomisa
    Jan 23, 2023 at 7:25
  • 21
    @skomisa That reason to reject is when you change one acceptable way of formatting to your preferred way of formatting (e.g. brace after method declaration to brace on its own line). Fixing indentation as shown is definitely an improvement in my opinion, and thus not unnecessary. Jan 23, 2023 at 11:21
  • 6
    @skomisa I don't think it's worthless. It takes mental energy to look at code like this and wonder: why the extra indentation? It's a "question smell", if you will, indicating either that OP doesn't know how to format code in our editor, doesn't care to format code, wasn't aware that it was indented because they didn't look at the post, etc. You can argue that minor grammatical typo fixes and so forth, like changing "your" to "you're" or capitalizing the first word in sentences in a post, are for aesthetics and don't improve fundamental comprehensibility of a post. But they are improvements.
    – ggorlen
    Jan 23, 2023 at 19:21
  • 2
    @skomisa the quotes in your first comment are grouped under a point called "no improvement whatsoever". I.e., it's saying unnecessary is improvement <= 0, not improvement < some minimum. Jan 23, 2023 at 19:33
  • 1
    @ggorlen The majority of questions and answers on SO can be improved with edits. The issue is whether certain edits are worth the time and effort of the editor and the reviewers. And I challenge the argument that this specific change is justified because of "mental energy" required the read the post. I agree with the OP that the change is "miniscule".
    – skomisa
    Jan 23, 2023 at 19:33
  • 9
    @skomisa I love to see edits like this. I can whack "accept" in a heartbeat and know that future visitors won't need to scroll right to see the code. A definite, clear-cut and instant improvement. I don't think all edits need to be overhauls. Those take more mental energy to review, fix and approve because there are often unnecessary or counterproductive changes hidden in there that need to be sussed out and dealt with. It's like dealing with a monster pull request with one huge commit or lots of small, focused commits.
    – ggorlen
    Jan 23, 2023 at 19:35
  • 1
    @HymnsForDisco You are cherry picking your quote to argue that any improvement whatsoever is justified. But the SO documentation also states "Even small changes can be good edits", meaning that not all small edits are good edits. The SO documentation on edits is giving us conflicting advice. Arguing that all editing improvements to a post are worthwhile is not a a hill worth dying on, but have at it if you think otherwise.
    – skomisa
    Jan 23, 2023 at 19:39
  • 6
    @skomisa I'm not saying that the edit is worthwhile, just that it shouldn't be rejected. I understand your point that some edits are so small they were not worth the effort to make them in the first place, and I agree. What I don't understand is how that justifies rejecting it when you see it in the review queue. Jan 23, 2023 at 19:43
  • 1
    @ggorlen Re "and know that future visitors won't need to scroll right to see the code", do you realize that after the edit it was still necessary to scroll right to see the code?
    – skomisa
    Jan 23, 2023 at 19:43
  • 7
    there's no sense in rejecting an edit that is a clear improvement just to punish the editor for not fixing other things. That's what improve edit is for.
    – Kevin B
    Jan 23, 2023 at 19:45
  • 6
    @skomisa It's hard to tell from the screenshot--it looks like they've artificially constrained the viewport, but it's still an improvement. I'm not too concerned with the exact details of the edit in OP's question but rather the general pattern at hand. Most of these edits do in fact eliminate horizontal scrolling, or at least reduce the amount of scrolling. It's a step in the right direction and doesn't need to be all-or-nothing.
    – ggorlen
    Jan 23, 2023 at 19:45
  • 2
    I seriously doubt improving the documentation is going to help this. Besides, what is considered a valuable and useful edit differs per community. most of the help center is community agnostic.
    – Kevin B
    Jan 23, 2023 at 20:00
  • 5
    @skomisa Do you find your time in the edit queue is disproportionately taken up by simple edits like this? Jan 23, 2023 at 20:11
  • 3
    @skomisa Isn't it good to encourage folks to continue posting edits that are clear improvements?
    – endolith
    Jan 23, 2023 at 21:46
  • 4
    @skomisa In the past there was a rejection reason because the edit was too trivial (too minor). It was removed, because the conclusion is that if you think an edit is too trivial, you should prove that yourself by hitting the "improve" button and performing that edit, otherwise if the edit is not destructive or nonsensical, or changing one bad thing for another bad thing, then you should hit "accept". Jan 24, 2023 at 10:58
-1

A long time ago in a galaxy far far away, we had a reject edit reason that covered exactly this scenario: too minor. This was unequivocally nuked (see #3 at end) for various reasons, one being the claim that "too minor" was too subjective.

The problem with removing this rejection reason, of course, is that the edit queue becomes entirely composed of minor edits by <2k reputation users who have figured out that it's the best way to farm rep. This entirely invalidates the original intent of that queue, which was to encourage substantial high-quality edits from new users while simultaneously discouraging them from farming.

What really should happen is that we have a bot that automagically performs these extremely simple formatting and spelling fixups, which would entirely prevent the farming problem by removing the ground from under the farmers' feet. Apparently however, allowing users to farm rep to the point where they are able to edit anything they want without oversight by anyone, is considered the lesser evil than having logical automation on what is supposed to be a programming website.

9
  • 6
    Users making useful contributions to this website and gaining a limited amount of rep that brings an inconsequential level of privileges... Man, what will they think of next?! Jan 24, 2023 at 12:34
  • 3
    It's only possible to earn a maximum of 1000 reputation total from suggested edits (see here), so it's not possible to reach 2000 reputation by suggesting edits alone. Jan 24, 2023 at 12:36
  • 7
    The idea that editing is a simpler way to farm rep than posting answers or questions makes no sense to me. I'll give you that it is less risky (no chance of downvotes). Jan 24, 2023 at 13:32
  • 2
    for some people, answering questions doesn't come easy. It's particularly hard when you cant comment to request clarification when the majority of questions need it. Suggesting edits is easy, frictionless, and only limited by the queue, and provides reputation without any real competition with other answers.
    – Kevin B
    Jan 24, 2023 at 15:49
  • Autoformatting is great but it can also change the logic of code. Rubocop always seems to mess up my multiline strings, for example. So bots are probably off the table.
    – ggorlen
    Jan 24, 2023 at 17:37
  • 2
    @KevinB I agree, but you can only get a maximum of 2 reputation points per suggested edit no matter how good it is. For posts, on the other hand, you get 10 reputation per upvote, and the number of upvotes you can get is theoretically unlimited. So while I agree that suggesting edits is probably the easiest way to get some reputation, posting is probably easier per reputation point. Jan 24, 2023 at 17:56
  • 1
    Slightly OT, but re your third paragraph on automagically editing posts, it seems that the issue has been reviewed and rejected. See the accepted answer to Remove "please help" from the end of bodies. It's interesting that one justification for NOT automatically fixing "things like "please help" or "thanks in advance"" was "there are usually more pressing issues that need to be fixed in the post". That position is clearly at odds with the prevailing view here that any improvement to a post is worthwhile.
    – skomisa
    Jan 24, 2023 at 18:25
  • "is that the edit queue becomes entirely composed of minor edits by <2k reputation users who have figured out that it's the best way to farm rep." Someone who fixes a spelling error in five separate, already-decent questions has unarguably done more to improve the site than someone who posts an answer to a garbage question from a new user that fixed the new user's problem. In fact, the first person has made the site better, and the other has helped make it worse (by interfering with the process for cleaning up garbage questions). Sep 10, 2023 at 5:10
  • 1
    Also, let's not gaslight ourselves: the primary cause of problems with the edit queue is the fact that it is a queue*. A sensible system would involve people actively searching for the pending edits that they're best qualified to evaluate, and actively evaluating them, and a site search that made this process trivial. Sep 10, 2023 at 5:12

You must log in to answer this question.

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