-16

I have recently asked a question about memory usage in C++. Since it is closed and deleted now, if you can't see it: I've outlined my attempts to free some memory and asked whether my understanding of what's happening was correct. Immediately it received a downvote and a vote to close due to lack of details.

In total there were four downvotes and at least three votes to close, yet no single request for extra detail was provided. Not only that; I've received a ton of helpful comments, none of which was asking for clarifications - and instead just straight answering the questions I've asked in the OP. Would not that be more helpful to actually mention which details are missing, and where additional clarity is needed?

15
  • 2
    There is probably some irony in missing details or clarity about requests for details or clarity. Would not that be also more helpful to have details and clarity in the question to begin with? Hopefully, everyone agrees that helpful things are helpful. So what exactly do you want to discuss? Commented Aug 29, 2022 at 9:45
  • Your question starts with: "I have noticed that my program uses a lot of memory, and I've found at least some place where it can be optimized" and my first reaction would be to ask - have to analysed and found the logging to be the biggest memory leak? Or did you decide to try and optimise logging on a whim without any backing data? And this is a relevant question because we get a lot of optimisation questions that are irrelevant or unanswerable. Maybe some fiddling would give some benefit. But chances are this would be negligible, especially if you've not focused on a real issue
    – VLAZ
    Commented Aug 29, 2022 at 10:09
  • @MisterMiyagi for the author it may not be obvious, which details or clarity is needed unless others point that out.
    – SBF
    Commented Aug 29, 2022 at 10:11
  • 1
    @VLAZ question was not about how to optimize memory in general. It was clearly stated that I had doubts about correctness of my assumptions. I was not asking anyone to help me find where to save memory
    – SBF
    Commented Aug 29, 2022 at 10:13
  • 6
    Then that sentence is completely irrelevant. Not only that but it's misleading. If you want to know about something in general, don't put specific context to it claiming that you've got a memory problem you need to address.
    – VLAZ
    Commented Aug 29, 2022 at 10:14
  • @VLAZ when I was asking such general questions before, without providing at least some examples, I was getting them closed due to lack of clarity/details.
    – SBF
    Commented Aug 29, 2022 at 10:16
  • So, how did it go now? Any better?
    – VLAZ
    Commented Aug 29, 2022 at 10:19
  • 1
    @VLAZ well, I've tried to be more detailed, and got a similar reaction. People here are quite helpful in answering my questions, but not really in terms of telling me how exactly should I phrase them. Could you give an example, how would you ask a question have you been in my situation? Just an outline would come handy
    – SBF
    Commented Aug 29, 2022 at 10:23
  • I'd personally not ask this question. Because it seems very irrelevant. And even if I decided to, I'd first analyse whether my observation is correct as Eric Lippert suggests in his article "Which is faster". Can something have an impact? Maybe. Will it have an impact - impossible to say for certain without measuring it in real context. At least when you have a rather constructed problem. And the comments actually suggest it's an XY problem.
    – VLAZ
    Commented Aug 29, 2022 at 10:32
  • 1
    @VLAZ: I've did my measurements, it saved 10% of memory usage, that's why I went for that
    – SBF
    Commented Aug 29, 2022 at 10:37
  • 1
    @Ilya "for the author it may not be obvious, which details or clarity is needed unless others point that out." Point is, the way this discussion is phrased puts the burden very one-sidedly on the voters. It's purely about being helpful to the author and the expectation from voters to provide details and clarity. Now I get that this situation hits hard (been there myself) but the "other side" are people too. See e.g. Why isn't it required to provide comments/feedback for downvotes, and why are proposals suggesting this so negatively received? Commented Aug 29, 2022 at 11:57
  • @MisterMiyagi I've seen that post, and I don't think that it is necessary to leave comments when downvoting. I'm just saying that their absence does not help the author in improving the OP. Yet, when voting to close the OP is actually required to state the reason. And the names of those who voted to close are then provided, hence the anonymouity argument does not help here either. Overall, I think that when voting to close one gains very little by not providing a comment, even if one takes into account the post you've mentioned
    – SBF
    Commented Aug 29, 2022 at 12:20
  • 6
    @Ilya Close votes do not require a customised reason. As someone who regularly leaves comments, let me assure you that adding a customised comment that addresses the specific question and the perceived level of understanding of the OP is a significant time increase. I'm talking about an order of magnitude extra here. For people who try to curate many questions (remember, people have 50 votes per day) this can be a massive time burden. Commented Aug 29, 2022 at 12:31
  • 2
    "Q1"--Downvote & close vote. Ask 1 question. Also: Please read your post. What is the 1 question? Moreover: "My understanding is": What are you expecting in reply? If you're wrong, presumably you expect us to explain the semantics. Why haven't you? You give a result of your "understanding", but you don't explain how your mental model & reasoning gave that result. An answer could say whether that result is correct, but a yes-or-no answer is very seldom helpful, and whether yes or no we don't know your justification, hence whether it's wrong, and if it is we can't say where.
    – philipxy
    Commented Aug 29, 2022 at 13:57
  • 2
    You got quite a lot of comments there... It's not like your question was closed altogether without comment. It's hard to understand why you are still wanting more. Anyway, in order for us to productively have a Meta discussion, people need to be able to see the question, so I've undeleted it. I've also changed the closure status to mark it as a duplicate of related posts, which I think is more helpful than an "unclear" closure.
    – Cody Gray Mod
    Commented Aug 29, 2022 at 18:43

2 Answers 2

10

One of the people trying to help you, provided this comment at the end

And when you had "some problems with them when their capacity changes", did you understand what the "problems" were, and the underlying reasons for those "problems"? I suspect that a couple of keywords, for these "problems" were typed in Google, and something came back that says "use pointers". Well, C++ is not that easy. Using pointers has many important implications, such as the fact that you now have to keep track of them, and manage their memory. Instead, the next step would be to investigate, learn, and understand the reasons for those "problems", and what is the right fix for them.

So that commenter, together with several others prior to that, is suggesting that you should change your approach to the problem. It's unclear why you don't want to do that, other than when you added this comment...

...I'm tring to avoid using vectors of objects (rather than pointers to them) after I've had quite some problems with them when their capacity changes

What problems? You don't say, so the commenters don't know how to address that other than by giving general advice.

So you have what's called an XY problem. Unless we can determine what X is we can't really help because answering the question "how do I stop it hurting when I shoot myself in the foot", with "more anaesthetic" is generally rather less useful than finding out why you're doing it and suggesting something else entirely.

In the end because the question didn't seem to be broadly useful or going anywhere (in the eyes of the delete voters), they deleted it.

14
  • My question was about memory managed by pointers being freed or not, and even though comments on changing the approach are useful, I don't see how this question lacks clarity on its subject. It's not XY, it is a yes/no question. Unless of course there is "yes" under some circumstances and "no" under the other. But as appeared, it is perfectly binary in my case.
    – SBF
    Commented Aug 29, 2022 at 10:15
  • 1
    But the answer is, don't do it in the first place. I.e. neither yes nor no. Commented Aug 29, 2022 at 10:17
  • 1
    So, I should accept the fact that if I ask whether integral of 1/x over real line is defined or not, I will receive the answer "just don't take integrals of such functions" and that be it? What's wrong with asking how things work. Suggestion not to do this is welcome, but only as a side comment.
    – SBF
    Commented Aug 29, 2022 at 10:21
  • You might get comments as to what problem you're solving that you think the integral of 1/x is the solution. Once we determine it's Gabriel's Horn and you agree to change the question to what it is you don't understand about that then we can likely make progress. And that's exactly what you got in this case, suggestions not to do this as comments. Commented Aug 29, 2022 at 10:25
  • 1
    Ok. So, if I ask a question and get comments of the like "why would you do that in the first place", my reaction should be to provide this context in the OP - and that should stop question from being closed due to lack of clarity or details?
    – SBF
    Commented Aug 29, 2022 at 10:28
  • 6
    If many experienced programmers do things a certain way because they have learned through experience that doing it another way leads to lots of bugs but you disagree and want to write fragile code, should we help you fix bugs in your fragile code or encourage you not to write fragile code in the first place? Which approach will turn out best in the end? Which will help lots of people? If you say you only want help with your specific fragile code how is that contributing to a corpus of generally useful questions? And that's what we're here for, to help the many, not the few (or the one). Commented Aug 29, 2022 at 10:31
  • 2
    Ok, so if someone answering my question benefits just me, than I should not be surprised that this question is not welcome on SO?
    – SBF
    Commented Aug 29, 2022 at 10:37
  • 3
    Continuing with a flawed approach doesn't even benefit you in the long term. To paraphrase Henry Ford, you want a car, not a faster horse. Commented Aug 29, 2022 at 10:47
  • Neither does not getting answers for the questions I've asked.
    – SBF
    Commented Aug 29, 2022 at 10:49
  • @Ilya "Ok. So, if I ask a question and get comments of the like "why would you do that in the first place", my reaction should be to provide this context in the OP - and that should stop question from being closed due to lack of clarity or details?" Yes. (assuming it includes all other relevant details).
    – 41686d6564
    Commented Aug 29, 2022 at 11:00
  • 4
    Regarding "neither does not getting answers...", no one is guaranteed answers on a site staffed by volunteers, and in fact to get decent answers it is you, the asker's responsibility to motivate those who would answer to want to answer. Again, yours, the responsibility is yours alone. If you don't do that, then you may be disappointed when you don't in fact get an answer, which you're finding out. Part of this may include explaining why you want to do things in a way that experts in a field consider bad. Commented Aug 29, 2022 at 11:02
  • However, if you really do know what you want and you have good reasons for doing what's usually not recommended, you should make that very clear in the post. If you need more info, I recently posted an answer on MSE about this situation. @Ilya
    – 41686d6564
    Commented Aug 29, 2022 at 11:04
  • 2
    @Ilya you provided details about your actual aim being memory optimization with logging, if you just wanted an answer to "If I don't store the value of myLog to a vector, would the memory it occupied be free after I leave the SwitchMethod?" you should have asked just that and given code that showed only that relevant part. In that case your question should probably have been closed as a duplicate of: stackoverflow.com/questions/16094568/… (Note: I am not a c++ SME) Commented Aug 29, 2022 at 11:05
  • @AbdulAzizBarkat ok, thanks
    – SBF
    Commented Aug 29, 2022 at 12:21
6

Would not that be more helpful to actually mention which details are missing, and where additional clarity is needed?

Yes, it would. And close voters are free to leave a comment if they want to.

However, commenting is not a free action.

In order for a comment to be helpful, it has to significantly go beyond the canned close messages. That means estimating what language is appropriate for the OP, putting all the shortcomings into words, and ideally providing actionable advice. All of that scaled just right to fit into 600 characters with no advanced formatting.
That is assuming the first comment is enough. OP disagrees with the reasoning? More comments. OP needs more advice? More comments. Missed some key points? More comments. New details change the question? More comments!

We do not enforce comments on downvotes, and aside from anonymity the same reasons apply for close votes as well: It would be a notable barrier to voting but in the end could not even guarantee that it creates useful comments.

If you do get helpful comments alongside votes, by all means be happy and thankful for that. But do not expect a benefit from forcing voters to provide extra details when their voting is needed because most people don't bother with details in the first place.

4
  • 1
    I definitely feel the lack of clarity in your last sentence, yet it seemed to convey some important thought.
    – SBF
    Commented Aug 29, 2022 at 14:36
  • 2
    @Ilya That is exactly the kind of reply that makes justifying votes a mug's game. The asker is expecting help – both as answers and advice – yet voters open themselves up to more trouble and effort unless their comments are 100% waterproof. Commented Aug 29, 2022 at 14:55
  • 1
    By no means I think you are obliged to make your answer more understandable to me, but thanks for doing that, of course. I still don't get the last sentence, though. I am not suggesting to force voters to provide extra details, I'm saying that if I said "your question lacks details" and I don't say which kind of details I think are lacking, I don't expect this question to be improved.
    – SBF
    Commented Aug 29, 2022 at 15:35
  • @Ilya Well, what are you suggesting then? What do you expect from the people you have addressed here? Commented Aug 29, 2022 at 16:20

You must log in to answer this question.

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