The following is an excerpt from Matt Legend Gemmell's blog:
whathaveyoutried.com
If you’re a developer and you’re about to ask another developer a technical question (on a forum, via email, on a chat channel, or in person), you’d better be ready to answer the question “What have you tried?”
So, if you’re going to ask a technical question, I guess the first thing I have to say to you is: Great! You’re asking a question, and that means we have a better than even chance that you want to learn something. That’s usually awesome, and I stand ready to salute you.
But wait. Have you considered - really considered - what it is you’re about to ask? Is this the right time to ask, or can you take one more step first, which might either make your question clearer (good) or even unnecessary (probably better)?
Try taking a few minutes to run through these points:
- Have you broken the question or problem down sufficiently to really ask something concrete? In software engineering, you can pretty much divide problems into the two categories of (1) things that can be broken down further, and (2) things you already know how to do or can look up trivially.
- Is your problem the sort of standard question for which there’s definitely already some sample code and documentation available? There isn’t a GUI toolkit in the world that doesn’t have a section in the tutorial on how to put a window on screen. There’s no programming language that doesn’t tell you how to read the contents of a file. Skim the documentation, or do a quick search. If your problem is that simple, the answer is probably just moments away. You can find it!
- Try searching the web. This is glib advice, I know, but stay with me. If you’re having trouble getting a decent result, you need to narrow things down. Don’t search for “if statement” if you’re just interested in an if-statement in ruby; instead, try “ruby if statement”. What might be even better is finding a site that’s specific to the language or technology you’re working with, and searching there. For Cocoa, this is the CocoaBuilder list archives. Someone else has probably asked your question - or maybe a hundred someones.
- Whoever made your language or framework or API or whatever also created a bunch of sample code; really, they did. It’s designed to help you get on your feet with various common tasks, and there might be some code that does at least some of what you want to do. It’ll take you only a few minutes to check, and at the very least you can grab a load of code which will come in handy at some point in the future.
- Use your IDE’s online reference or other built-in documentation. Xcode has a documentation browser. Eclipse etc will show you the Java class documentation. PHP.net has you covered for your PHP scripts. Find the canonical reference for what you’re working with, and search it. You’re going to find something that’s helpful almost every time.
OK, you’ve gone through those steps and tried at least a few of them. I can now finally say congratulations. Either you’ve solved your own problem (great), or you are now officially ready to be helped.
When I ask you “what have you tried?”, you can say with confidence that you’ve tried all that stuff above, and you can tell me anything promising you found, or you can say that you’ve at least come up empty honestly. I’m going to help you at this point, because I can see that you want to learn and that you’re willing to work for it, and so I want to teach you.
That’s the key realisation. When you’re asked “what have you tried?”, it doesn’t mean “show me the code you’ve written, or piss off”. What you have to do is at least try to help yourself - and the trying is the important thing.
Not just for avoiding pissing off someone who would otherwise be willing to give freely of their valuable time to help you, but actually for your own development. Do it enough times and the number of questions you’ll actually have to ask will start to go down. You’ll also be in the position to help others (including me), and that way everybody wins.
So next time you’re considering asking a question, you’d better be ready with a convincing answer when you’re asked “What have you tried?”
If your answer amounts to “not a lot”, take my word for it: the next question you get back will be “then why should I help you?”
Pretty useful advice, IMO.
And a good weapon against Help Vampires.