6

I answered a question yesterday that ended up closed as not constructive. It was slightly vague, but it wasn't unanswerable, and had a single definite answer (it is literally asking "does prepare() protect against SQL injection on its own no matter what?", to which the answer is a definite "no")

The question itself is asked by quite a lot of people in my experience, who are coming from ext/mysql to PDO or mysqli (from hanging out in the PHP chatroom), and are confused as to what preparing a statement actually does.

So I just popped this edit into the suggested edits queue and was met with a bunch of rejects. I clarified it and removed wording that made it seem as if the OP was rambling to get to the actual point of the question, with an example (the OP has also accepted an answer at this point, and made it clear that it is indeed what they were asking).

Is adding correct wording and a code example to a question really "changing too much of the meaning"? I'm strongly disagreeing with the decision of the reviewers, here.

EDIT: In addition, are reviewers getting lazier and lazier? If something fixes problems but causes another, it is often completely unacceptable to leave the question as it was. I thought this was exactly what the "Edit" button was for?

2 Answers 2

3

There are two audiences for a question - the original asker, and everyone else who comes later looking for an answer to the question.

Stack exchange is built trying to service the later group. The bread and butter of a question and answer site are the questions and answers themselves.

If the original question is poor (closed), fixing it for the everyone else, yet to come and find the answer is useful and good for the site. It doesn't matter too much if the question changes slightly from the original poster's intent - a good, open question is better than a poor closed one. The later only serves as an example of how not to ask a question (more than enough examples of that). Furthermore, the edit may show the asker how to ask a question better next time.

A key consideration and courtesy is to make sure other existing answers to the question don't become invalid or wrong.

If the question isn't deemed needing improvement, then such a significant change could be deemed unwarranted.

2
  • "A key consideration and courtesy is o make sure other existing answers to the question don't become invalid or wrong." And how does one plan on accomplishing that without changing any code in the answers, thus invalidating the edit?
    – Makoto
    Jun 5, 2013 at 5:42
  • 3
    That is a case by case issue and should be commented if done. Do consider it is no worse than the OP adding clarifying information to try to get the question reopened and invalidating some assumptions people who answered made. An open good question is better for the site than a closed one.
    – user213963
    Jun 5, 2013 at 5:52
1

Removing rambling and cleaning up grammar: good edit.

Adding code examples: bad, bad edit.

Here's why:

Imagine you're playing the game Telephone. You say to someone "Hi, this is going to be good!", and it passes through several chains until the message becomes "Hi, this is going to suck!" The meaning has changed from what you've originally conveyed it to be.

Same principle applies here. Once you put code down, you're putting words into the OP's mouth. There's no indication that this is the code that they are working with, or if they understand the domain enough to have that much code yet.

The onus is on the asker, not the editor, to provide context and code examples. Have them do their due diligence in asking the question by providing their own code.

5
  • 2
    The question has already been answered, and everyone who answered in that question already knows what the OP was asking, so is adding a sample of what string interpolation with a prepare is actually a bad thing? It seems a shame to be forced to get rid of a question that can stand on its own (and is really, really common) and post a duplicate of it just to clarify something that could have been clarified in the question body itself. The OP was likely not going to edit that, and closed php questions are usually deleted swiftly by the php cv-ring.
    – Amelia
    Jun 5, 2013 at 5:28
  • That doesn't change the fact that the new code wasn't the original question. It shouldn't have been closed as "not constructive", but rather as a duplicate (since there are two answers in the comments that link to valid answers, one of which is still open). Commonality implies more education of the existence of the duplicate answer, rather than shoehorning in code that might not have been what the OP was trying.
    – Makoto
    Jun 5, 2013 at 5:33
  • 1
    People also often forget that Stack Exchange is part Wiki; why should we rely on the OP to improve something when questions and answers are cc-wiki, and the edits are applicable to a wider audience?
    – Amelia
    Jun 5, 2013 at 5:34
  • I won't disagree (or argue) that editing posts is a central point to the site. What I'm getting at is that adding code into a question changes the question. That code was not what they asked.
    – Makoto
    Jun 5, 2013 at 5:36
  • 1
    @Hiroto, it may be worth taking a look at the question that I asked recently. There is a disconnect between the documentation and the accepted practice on the subject (see the answer and the linked MSO questions). It is becoming clear that code edits (except for minor typos) in either questions or answers will be rejected. Jun 10, 2013 at 20:03

You must log in to answer this question.

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