2

I've been working on this question "Using automatic variables in C++ Constructor" and I found that besides my primary answer,- that referred just to the possibly compilation related problems -, I immediately spotted the OP's got some semantical concept completely wrong.

Should I?

  • just close vote the question, because some appropriate answer by means of a [duplicate] will fix the actually stated problem
  • or/and focus on the sematical flaw introduced by the question, and give an appropriate answer to fix this (foreseeing the misconceptions)

There's also a little debate, regarding this particular answer for the question mentioned above.

3
  • 1
    I don't agree that your duplicate answers the "actually stated problem." It's another way to write the code (a way that is not only more expressive but may be more efficient) but doesn't in any way answer the question of stack vs. heap. All I can say is, I'm glad I don't work with either of these question's authors. Sep 4, 2014 at 3:30
  • @MatthewLundberg I've covered this question about usage of new. There's no concise/definite answer for this, unless more requirements are clarified. I'd prefer the simple variant (without involving homebrew memory management) for almost every case. Sep 4, 2014 at 3:36
  • Of course there is no concise or definite answer to the question. The question itself doesn't lead to one. Sep 4, 2014 at 3:41

1 Answer 1

1

This seems to be a little like an XY problem, but with a twist. In this case, you notice additional problems that the OP hasn't asked about (yet).

If you are willing to go to the extra effort, I would answer both pieces. Make sure to answer the actual question but feel free to add a piece below that explaining the semantic problems the OP is likely to encounter as well.

Of course, if the question should be closed as a duplicate, close it, but if the question isn't about the (duplicate) semantics, I wouldn't judge it on having a problem with them for close vote purposes.

About the debate, I would side with the poster. He answered the question, and isn't obliged to discuss additional problems that aren't relevant to the question posed.

6
  • My point is (not so much pointing to the duplicate), that the direct answer (I gave myself also) leads the OP in a completely wrong direction to solve their actual problem. Sep 4, 2014 at 1:16
  • 1
    For me, that just adds motivation to put the extra info in. You certainly should not focus on it, since you are avoiding the actual question asked. As was argued in the answer comments, the example given could be contrived so its not an issue at all. Either way, you have to actually answer the question; putting additional information is great, but not required. Sep 4, 2014 at 1:19
  • "... but not required." If omitted, doesn't that lead just to additional unnecessary traffic, because the next thing will be the OP asks for what's wrong with their concept? Sep 4, 2014 at 1:23
  • Yes, but thats not necessarily a bad thing as long as its asked as a separate question (better than a chameleon question). If a future visitor looks at the question for the programming reason (and views the example as contrived) then they don't care about that part. In addition, since the new question will be about the semantic piece, it will be much easier to find via Google in the future. If I looked for this topic, and found a big discussion on semantics, that would not be helpful to me as a future visitor. Sep 4, 2014 at 1:25
  • OK, your point's are all about the quality of the question itself (which is too low being asked here IMHO), not so much about the answers already given there. Sep 4, 2014 at 1:29
  • @πάνταῥεῖ My point was trying to explain how I would approach answering a question in such a situation, not really about the quality of the question or answers. I do believe that the debated answer is fine as is, though it could be better by discussing the additional issues. Sep 4, 2014 at 4:06

You must log in to answer this question.

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