Skip to main content
2 of 2
added 520 characters in body
Mathieu Guindon Mod
  • 75.1k
  • 4
  • 98
  • 241

Following the editing-out of the last sentence (which I've approved), I've reopened the question.

OP is clearly interested in improving their code, and barring that last sentence the post in on-topic, and the edit does not warp the OP's intent.

I've approved an edit that makes your question perfectly fine. If you want to ask specifically why it's echoing and how to avoid that, feel free to ask that specific question on Stack Overflow. – Mathieu Guindon♦ just now

That said I don't agree with the assessment of incomptence and intentions-interpreting going on here. Often a first-time poster will present code for illustrative purposes only to depict the specific problem they're asking about, and aren't really interested in a review or in improving their code. If all they wanted was an answer to the echoing question, then no edit could have salvaged it: it's indeed usually better to let the OP fix their question themselves, with proper guidance in the comments.

I do agree that sometimes questions are being closed in accordance with the site rules, but on the basis of an OP that is new to this community and doesn't necessarily know what they can and what they can't (shouldn't, anyway) ask in the body of their post. I draw the line at the OP's apparent intent: if they are interested in a peer review, and happened to slip an off-topic request in their post, the question can be saved. This isn't necessarily obvious, or easy, and nobody gets it right every single time.

Mathieu Guindon Mod
  • 75.1k
  • 4
  • 98
  • 241