Hey, hi again and welcome to yet another
lecture. In this lecture, I'll show you
how to ask a good programming question.
So I mentioned in the previous lecture
asking a good programming question is
very important to get a good answer, and
let me first show you what's the best
programming question. For instance,
[No audio]
I'm going to click on Ask question, and here
is the title of the question, that
programming question would have a very
generic title like that. Here is the
body of the question where you
have to describe your question in
detail. Some people, they just say I got
an error when trying to two numbers,
[No audio]
and they just post the question.
[No audio]
A better question would be to include the error
the code there that you executed, like that.
[No audio]
However, that is also not enough,
because you also need to show the error
message. So let me delete this, and a
good programming question would be, when
we're talking about questions that have
an error, questions that talk about an
error that you got in your code. So this
is your code, a good title would be to
include the error message, so that it
would be a good fit. If it's a very long
message, then you can
choose to include all with the name of
the error with all that, and then a good
question would be Hi, I run the following
code and expect text to get division
in the last print main parts, but I got an error.
[No audio]
Here is my code.
[No audio]
So you've put the code there of your entire script.
Don't worry, if your question is long,
it's better to be long than to be
incomplete, and
here is the error. Here,
make sure to include your entire
error TraceBack, including the output
as well. So from this line of the command
line, up to the next line, so this
entire thing goes to your question, just
copy it. Don't worry if it's long.
[No audio]
Can you help?
[No audio]
So that'd be a good
programming question. Now, this is still
missing something very important, and
that is highlighting of the code.
You need to select the code and click on
this icon here.
[No audio]
The error as well,
[No audio]
and let me post the question.
[No audio]
External links must provide free educational
content, just click on Proceed.
[No audio]
And here is a question here, and here is how
it looks like on the other end. So this
question has four good elements that
make it a good question. The first
element is that the poster is mentioning
what he or she expected to get as output
from the script that they were running.
So it says I was explaining to get the
division in the last print statement
which is this one here, but I got an
error. So the first thing is, you need
to include the expected output, you need
to explain what you were expecting.
Because otherwise, if you don't explain
what you are expected that the other
person who wants to help you doesn't
know the goal of your code, or of your
questions, so it doesn't know how to help
you to reach to that goal. So expect
output is the first thing. The second
thing is you need to include your entire code,
and make sure that you include
your code as texts is best to use text as
rather than screenshots
because text, the person who wants to
help you can copy your code and
run it on their Python interpreter.
But if you include
screenshots, they are images and it's
hard for other people to try out your code.
[No audio]
If you ask this on Stack Overflow,
your question would get closed because
if you ask it using a screenshot,
rather than the text version of your
code, the question will get closed
because there are very strong rules in
Stack Overflow to have a high quality
question and answer site.
So that's it second element. The third element is you
need to include your entire screenshot,
entire error TraceBack, sorry. So from
the beginning up to the end, whether its
the third element, and the last element, the
fourth element is you need to highlight
your code. Just like that. You see this
is much more visible and easier for
others to troubleshoot.
[No audio]
So the course interface has that function there that
you can highlight your code on Stack
Overflow, or you also have that
capability. So just go to Ask Question.
You write the code here,
and highlight it using this
curly brackets.
[No audio]
Yeah, that's it. If you ask good questions,
the odds are that you're going to get a
good answer as well. So I hope this
makes sense, and I hope I showed you
something that you didn't know, and I'll
talk to you later see you.