I got this odd comment to one of my answer earlier today:

How about showing how this would be applied to OP's question.

My answer (deleted since) was:

Try to split the string and use a range type to build the array: (1..10).to_a

The question was about building a list of IPs given two end points:

Ruby: How to convert IP range to array of IP's

Speaking personally, I'd rate my own answer as good enough, since it would have been more than enough to get me googling in the right direction. Admittedly, a better answer eventually creeped in -- it would have gotten my vote and acceptance.

Question for meta, though: is this type of answer (which can occasionally be long) valid, or not? More examples of the same type of hint-only answer:


Escape sequence for deleting next/trailing character?

My issue with getting comments that amount to "show working code" is that it reduces StackOverflow to a crowd-sourcing site. IMO, OP should get the same type of answer as he'd get from a busy colleague, e.g "try this direction, should yield something" rather than a deliverable.

  • 4
    IMO hint answers are the best answers (half the time) since you are answering & you are letting the OP understand the problem himself & only guiding him to the solution. – shad0w_wa1k3r Dec 16 '13 at 14:25
  • @AshishNitinPatil: and that should have been an answer. ;-) – Denis de Bernardy Dec 16 '13 at 20:28

A one line hint answer that just tells the OP to "try this" is bad.

But a long one that partially solves the issue and puts the OP at a stage where he will be able to proceed is OK.

The issue with hint answers is that they usually confuse visitors. I've had many programming problems, and when I come across a hint on a forum it just confuses me more because the hint is sometimes short or too vague. Long hints usually are almost as good as answers, though, because they explain the hint and the OP/visitor is better equipped to use it.

| improve this answer | |

You shouldn't be posting a hint as an answer. If you only want to provide a hint, then post it as a comment.

A hint is by definition intentionally not providing an answer to the question, and it is not appropriate on SE to post answers that don't answer the question.

That's not to say that you need to provide a fully coded solution to the problem asked, either. It is entirely appropriate to explain to someone what problems they have with their code, and how they would go about approaching solving it. There is however a difference between an explanation of a solution and just a hint. A hint is an explanation that is intentionally cryptic, or incomplete. We don't want incomplete explanations here, we want complete explanations. If you can provide a sufficently complete explanation to ensure that a reader will understand and be able to solve their problem without providing code, or with only small snippets of code, then that can make for a great answer.

If you don't want to provide a complete answer (with or without code) because you feel that the person asking the question doesn't deserve an answer, or because you just want them to figure it out on their own, or whatever, then that's fine. I come across questions where I just want to provide a hint without answering all the time, but if you don't want to answer the question then don't post an answer. If you just want to provide a hint, a little helpful tidbit of information that doesn't actually answer the question, but moves the reader along to the right direction, then there is already another mechanism designed for that: comments.

| improve this answer | |

I'd say it depends on the question. If the OP starts out completely lost, or having put in very little effort to figure things out on their own, then giving them a hint answer is appropriate - it helps them move forward, and in the end they'll understand the thing better. If they have enough comprehension to ask a specific question, then they should get a specific answer. On the other hand, I think the hint answer that you gave was a bit low-quality. If you're going to give a hint answer, you ought to offer some explanation on what's going on and how the system works along side - so that you avoid the situation where the OP simply fails to understand the hint, leaving them at least as confused as before.

| improve this answer | |

Hint answers are good. I often do them myself. However, you need to get them as close to the answer as possible. Sending people off googling answers is contrary to what this site wants to be; a repository of solutions. If we become just a repository of "get me googling in the right direction", what use is it?

| improve this answer | |

I agree about not having Stack Overflow become a job shop for lazy programmers. The question pointed to asks how to do something without showing any effort aside from the OP needing it to be done. It has my close vote.

However, if you are going to answer a question which is clearly a lazy question asking for a solution, and you are going to give a "hint" then at least flesh it out into a worthwhile answer. The answer you provide does not go very far, in fact it is only two lines (one of statement, and one of code).

There is value to hint only answers so long as they provide sound reasoning and perhaps some link to documentation or a simplified example.

| improve this answer | |

You must log in to answer this question.

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