As phase 0 of DevBootcamp comes to a close, I'm asked for my last cultural blog to write about how to ask good questions. Well this is an area that I find to be particularly important and have put much work into over the years.
I've always been frustrated by people in classroom environments who ask question after question until they've finally reached the actual problem they're having. I think it's an extremely useful skill to be able to dictate questions efficiently and accurately. Going into a new class environment, I've been taking extra care to be sure all of my questions are clear and explain exactly what my issue is. Let's take a look at a bad question that I've pulled from stackoverflow:
sending a filee using send_file method
send_file method doesn’t work with me in heroku however it works very will local that is the syntax that I used
send_file "#{Rails.root}/tmp/uploads/book/cover/#{params[:cover_path]}.#{params[:format]}"
The question above makes a few grave mistakes that could have been avoided. Most obviously, the title of the question and the question itself are poorly written using improper punctuation and grammar. If you want the fine folk online to take your coding questions seriously, the first step is to put in a little effort when you write them. If your question looks professional and serious, there's a better chance you'll get an answer that reflects those qualities.
Also notice that the asker does not really address the issue in the question title. When your asking a question, a good idea would be to write out all the problems you are experiencing first. Write your detailed question, and then finally give it a title that best summarizes what the actual issue is. Let's offer our asker an alternative way to ask his question.
Rails 'send_file' method works locally, not with Heroku.
I’m having an issue in heroku with getting the ‘send_file’ method to work.
Everything seems fine locally, but it isn’t working online using the following syntax:
send_file "#{Rails.root}/tmp/uploads/book/cover/#{params[:cover_path]}.#{params[:format]}"
Asking the question this way gives you a much better chance of recieving a serious answer. I would also recommend explaining more about what happens when he tries to run the code. Maybe include an error message he recieves. Give the answerers every possible bit of knowledge that they may need in order to solve the problem.
I'm going to continue working on asking clear and concise questions throughout the next 10 weeks at DevBootcamp. I'm so excited to start working and get the ball rooling! Hopefully I'll be able to get answers to all of my questions and get started down this exciting career path! As always, thank you for reading!
- Ricky