5

Take for an example this question:

I am trying to autograde some work submitted by others. Say an executable is called foo. It is supposed to write to standard out but in some cases, annoyingly, it instead opens a file and writes to that instead.

Is there some way (in linux) of running foo so that all its output, no matter if written to a file or to standard out, is piped to standard out?

I know that this can be done with LD_PRELOAD, but neither do I have the exact knowledge of how to do so, nor do I know whether there might be a better way.

I guess at some point, someone will come along and provide an answer involving LD_PRELOAD (or a possibly better solution), so I could just ignore this. But I could also leave a comment like:

This can be done using LD_PRELOAD; it is however ugly and may be hard to get right.

This would allow the asker to go for searching for LD_PRELOAD system call wrapper examples by him/herself. If (s)he is successful, there would be help provided, but there is a risk that the question remains unanswered, because the asker does not bother to write a lengthy answer describing what code was written in the end.

Should I or should I not leave such comments? Are they discouraged for this or other reasons?

3
  • 6
    Nope, not discouraged. A (pretty helpful) hint, is still better than nothing at all. Perhaps indicate in the comment that that is the extent of your knowledge so there are no follow up questions directed to you. Commented Jan 23, 2015 at 14:11
  • 2
    Absolutely! Such a comment might just be enough to trigger a dormant memory cell in another SO user or to get somebody to spend an hour or two to research it. Do be careful about qualifying it too much, avoid words like "ugly" and "hard" unless you know for a fact that it is a rabbit hole. Commented Jan 23, 2015 at 16:04

1 Answer 1

-6

I feel pretty strongly that it should be discouraged. Comments are for critiquing and for requesting clarification, and several parts of the GUI make that intention clear.

There are already plenty of ways in which we could "help" but are discouraged from doing so (for example, off-site resource requests are closed rather than answered) so the old counterargument of "it's okay as long as someone got helped" no matter how the helping was achieved doesn't really hold up in my view.

Writing "hints" in comments makes Stack Overflow questions look like forum/discussion board posts or chatrooms, which is not what they are. Stack Exchange was started so that we would have a clean Q&A format with which to interact. Let's stick to it, eh?

However there does not appear to be a consensus on this or an official policy... yet.

10
  • 3
    There is no consensus or official policy discouraging this because it would make no sense. Disregarding the OP, if I find a SO quesiton via google, what is better, having no additional content at all or having a comment saying "this should be possible with [...]"? Of course having the comment is better. It might also get OP or anybody else stumbling upon the question to research about the possible solution and create an answer which they can then post. The value of keeping SO "clean" by not posting the comment is close to zero compared to this.
    – l4mpi
    Commented Jan 23, 2015 at 15:11
  • 2
    @l4mpi: I already addressed that. Having the comment is not better. This is not a "information at all costs" website. Having the comment causes a mess, breaks the model, and enables help vampires and off-topic posters. I think you hugely underestimate the importance of that, but that appears to be in vogue seeing as such 'hint' comments are becoming more and more commonplace. Commented Jan 23, 2015 at 15:41
  • I am aware that people feel strongly against my opinion on this. However, I wanted to be sure to post it so that it is clear that there is no unified consensus that these "hint comments" are okay. Commented Jan 23, 2015 at 15:41
  • 2
    Well, that having the comment is worse is your opinion. But as long as the question (and thus the information in the comment) is on-topic, this doesn't "enable off-topic posters" (which would be bad, but we're talking about on-topic comments here). And I actually find the argument that it "enables help vampires" funny, because the kinds of people who don't read a tutorial before posting a SO question will certainly not be "enabled" by someone telling them to go research a feature - they're enabled by users answering their questions, which happens all the time and is actively harmful IMO.
    – l4mpi
    Commented Jan 23, 2015 at 15:51
  • 3
    TL;DR I guess you simply answered a different question than is asked here, namely if it's ok to give "hints" if you think OP hasn't invested enough effort and you don't want to just hand them an answer. I agree with you that it would be a bad idea to do so; but that's not the case OP is talking about.
    – l4mpi
    Commented Jan 23, 2015 at 15:56
  • @l4mpi: They're enabled by users answering their questions in comments, when the question will not receive actual answers due to being wildly crap or off-topic. :) And no, I have not answered "a different question than is asked here". This is precisely my opinion on "the case OP is talking about". Just because you don't agree with my answer doesn't mean you can pretend it is a mistake! :( Commented Jan 23, 2015 at 16:04
  • @LightnessRacesinOrbit But the question is about giving hints on an on-topic answer when one doesn't have the time/knowledge/resources to write a full answer. Commented Jan 23, 2015 at 16:42
  • 1
    @Angew: And my opinion is the same regardless of on-topicness. If you don't have the time/knowledge/resources to write a full answer, then leave the posting to someone who does. This is not a "chuck out whatever tidbits you can, at any cost, please for the love of god say something" website. Commented Jan 23, 2015 at 16:51
  • 1
    FWIW half-assed "answer" in comments can often be spelled as request for clarification. Using example given in question, one could post a comment like "did you consider using LD_PRELOAD? (it is however ugly and may be hard to get right)"
    – gnat
    Commented Jan 24, 2015 at 11:40
  • @gnat: Yeah I guess that'd be okay Commented Jan 24, 2015 at 13:15

You must log in to answer this question.

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