1
00:00:02,060 --> 00:00:07,580
Hey, in today's programming tool, I will teach you how to ask good programming questions.

2
00:00:09,200 --> 00:00:15,800
Now that is very important not only when you are a beginner, but also if you are an experienced programmer,

3
00:00:15,800 --> 00:00:21,980
because 30% of programmers use Stack Overflow every single day.

4
00:00:21,980 --> 00:00:24,260
So that is every single day.

5
00:00:24,350 --> 00:00:33,380
Now Stack Overflow, it is a forum on asking and answering questions so everyone can ask programming

6
00:00:33,380 --> 00:00:37,190
questions there and everyone can answer them if they know how to answer.

7
00:00:37,190 --> 00:00:45,140
So you get upvotes for giving good answers and you also get upvotes when you ask good questions.

8
00:00:45,800 --> 00:00:49,790
But getting upvotes is not the important thing here.

9
00:00:49,790 --> 00:00:57,470
You should know how to ask good programming questions because otherwise you will not get a good answer

10
00:00:57,470 --> 00:00:59,480
or you will not get an answer at all.

11
00:01:00,080 --> 00:01:07,070
So it's very important to know the way you communicate your problems to other programs so they can help

12
00:01:07,070 --> 00:01:07,400
you.

13
00:01:08,120 --> 00:01:15,980
So Stack Overflow is the biggest repository of question and answers, so you can basically find everything

14
00:01:15,980 --> 00:01:16,280
there.

15
00:01:16,280 --> 00:01:21,380
But if you don't find it, then you can ask your your own question.

16
00:01:21,680 --> 00:01:26,540
So I'll show you how to use StackOverflow and how to ask a good programming question there.

17
00:01:26,960 --> 00:01:29,300
First, let's simulate a problem.

18
00:01:29,300 --> 00:01:33,200
Let's suppose we were trying to create this program.

19
00:01:35,450 --> 00:01:43,760
So we ask the user to enter KGS using this input function and the user enters ten, for example, and

20
00:01:43,760 --> 00:01:48,050
then we try to multiply that by 2.2, but we get this error.

21
00:01:50,290 --> 00:01:54,370
So first of all, you might want to try to search on StackOverflow.

22
00:01:54,370 --> 00:01:56,650
So you want to go to StackOverflow.

23
00:01:56,650 --> 00:01:59,560
And this is the text box where you can search.

24
00:01:59,830 --> 00:02:07,480
I would suggest it to start with Python and then try to put some little details about your code and

25
00:02:07,480 --> 00:02:08,400
above the error.

26
00:02:08,410 --> 00:02:13,600
So in your code you have this input function, so you can say python input.

27
00:02:14,660 --> 00:02:17,720
Event here in error you have this type error.

28
00:02:17,720 --> 00:02:19,580
So it right type.

29
00:02:20,720 --> 00:02:21,350
Error.

30
00:02:22,650 --> 00:02:23,520
Presenter.

31
00:02:25,640 --> 00:02:28,280
And you'll get several answers there.

32
00:02:29,590 --> 00:02:31,300
These can be about anything.

33
00:02:31,300 --> 00:02:38,290
So we want to be more specific there and we want to include the entire error message, the last line

34
00:02:38,290 --> 00:02:38,770
here.

35
00:02:38,770 --> 00:02:46,150
So inputs and then copy and paste that type error can't multiply sequence by non end.

36
00:02:47,730 --> 00:02:54,480
So then you might want to click on the first answer, which usually might might have your solution.

37
00:02:55,680 --> 00:03:02,430
And then down here you have this answer so you can get some clues that this is saying you need to convert

38
00:03:02,430 --> 00:03:03,690
it into a float.

39
00:03:06,020 --> 00:03:07,850
And that is actually the solution here.

40
00:03:07,850 --> 00:03:11,540
So this value will be a string.

41
00:03:11,570 --> 00:03:14,540
So you want to convert it into a float.

42
00:03:17,610 --> 00:03:18,930
Run the codes again.

43
00:03:19,320 --> 00:03:20,940
Answer ten perhaps.

44
00:03:21,600 --> 00:03:22,740
And now no error.

45
00:03:22,740 --> 00:03:29,190
So if I print this out to see the outputs, I'm going to get 22.

46
00:03:30,060 --> 00:03:31,680
So 22.0.

47
00:03:31,680 --> 00:03:33,510
So that is the solution.

48
00:03:34,020 --> 00:03:36,800
Now, that was the research part.

49
00:03:36,810 --> 00:03:45,360
So how to search for a problem so you can search using that box or you could search directly on Google.

50
00:03:45,360 --> 00:03:50,430
So you have to write like Python inputs type error and press enter.

51
00:03:52,410 --> 00:03:56,730
And usually the first few results are from StackOverflow.

52
00:03:56,760 --> 00:03:58,690
In this case, it is the second result.

53
00:03:58,950 --> 00:04:02,010
If you click that, it will take you here.

54
00:04:02,040 --> 00:04:04,710
So this also is another question from somewhere else.

55
00:04:04,710 --> 00:04:09,510
And it also suggests you to use float in front of input.

56
00:04:09,930 --> 00:04:13,030
Now this row input is actually from Python two.

57
00:04:13,050 --> 00:04:17,640
So this is quite an old answer by the way.

58
00:04:18,390 --> 00:04:22,680
Raw inputs was used previously instead of inputs, which is used now.

59
00:04:23,310 --> 00:04:25,190
But this stays the same.

60
00:04:25,200 --> 00:04:28,560
So that is how to research a question.

61
00:04:29,370 --> 00:04:33,920
Now let's see how we can ask you the programming questions.

62
00:04:33,930 --> 00:04:41,340
So on StackOverflow, you can use this ask question button and then you want to provide the title and

63
00:04:41,340 --> 00:04:43,230
the description of the problem.

64
00:04:43,890 --> 00:04:51,660
The title should be written in a way that you should be able to describe your entire question in one

65
00:04:51,660 --> 00:04:52,440
sentence.

66
00:04:53,070 --> 00:04:57,930
So in our case, let me undo this so we get the error.

67
00:04:59,210 --> 00:05:00,620
Reproduced.

68
00:05:00,800 --> 00:05:03,440
So when we run this, we enter a number.

69
00:05:04,250 --> 00:05:05,210
We get this.

70
00:05:07,280 --> 00:05:20,720
So you could say type error when trying to convert k j to ll be s so you're trying to convert kg to

71
00:05:20,720 --> 00:05:21,500
pounds.

72
00:05:22,360 --> 00:05:27,400
But you get a typer and you're using inputs.

73
00:05:28,470 --> 00:05:29,700
Against StackOverflow.

74
00:05:29,700 --> 00:05:35,940
We'll suggest you some existing answers so you can click there if you want.

75
00:05:36,180 --> 00:05:41,000
Otherwise, you can continue with writing your the body of the question.

76
00:05:41,010 --> 00:05:48,330
And here is where you want to be very specific and I'll show you the anatomy of a good programming question.

77
00:05:48,990 --> 00:05:52,620
So first of all, you want to describe what you tried.

78
00:05:53,430 --> 00:06:08,700
I'm trying to get kilograms from the user and convert them to pounds using the code below.

79
00:06:09,240 --> 00:06:11,070
And here is where you paste your code.

80
00:06:11,080 --> 00:06:13,350
So that is the code I copied.

81
00:06:13,440 --> 00:06:15,080
I go here and I paste it.

82
00:06:15,090 --> 00:06:21,320
It's very important to select the code and press that button to highlight the code.

83
00:06:21,330 --> 00:06:30,570
Otherwise the code will be shown in a very chaotic manner and perhaps you'll not get any good answers.

84
00:06:31,050 --> 00:06:38,520
So you see down here how the code will display when I highlight it and don't provide screenshots of

85
00:06:38,520 --> 00:06:44,760
your code, so don't provide an image which has the code inside because others cannot copy the code.

86
00:06:44,760 --> 00:06:51,960
So they might want to try the code on their own ID And the only way to do that, the only sane way to

87
00:06:51,960 --> 00:06:54,240
do that is by providing the text.

88
00:06:55,100 --> 00:07:00,680
Not an image, then you want to describe what error this produces.

89
00:07:01,550 --> 00:07:07,040
So you say that code produced the following error.

90
00:07:08,350 --> 00:07:11,260
And here you want to paste the entire error message.

91
00:07:11,260 --> 00:07:12,340
So be careful.

92
00:07:12,490 --> 00:07:14,050
You want everything.

93
00:07:14,500 --> 00:07:18,040
So all the details, which is the rate text.

94
00:07:20,050 --> 00:07:23,350
Again, the code has to be highlighted.

95
00:07:23,800 --> 00:07:30,520
The error message is also code, so it has to be highlighted and then you want to describe what you

96
00:07:30,520 --> 00:07:32,410
expect the code to do.

97
00:07:37,150 --> 00:07:44,200
I expect pounds to be converted from cage.

98
00:07:45,960 --> 00:07:56,910
And then finally, you want to ask the question again How can I get the KG from the user and convert

99
00:07:56,910 --> 00:07:59,890
them to pounds?

100
00:08:00,480 --> 00:08:05,970
So that's what you want to do and you want to ask that question at the end of your post.

101
00:08:06,870 --> 00:08:08,760
Finally, you want to provide some tags.

102
00:08:08,760 --> 00:08:16,830
Python is the first tag, then input perhaps, which is the function you're using and maybe the error

103
00:08:16,830 --> 00:08:18,600
type error.

104
00:08:20,710 --> 00:08:24,320
You see, these are existing tags that others have used before.

105
00:08:24,920 --> 00:08:27,320
So StackOverflow is suggesting them.

106
00:08:29,410 --> 00:08:31,720
And then if you press on, review your question.

107
00:08:32,020 --> 00:08:39,880
So you just have look at the question and then post your question and it will post it publicly on StackOverflow.

108
00:08:39,880 --> 00:08:45,730
And usually you get answers very quickly in a matter of minutes most of the time.

109
00:08:45,730 --> 00:08:49,300
So that is the anatomy of a good programming question.

110
00:08:49,510 --> 00:08:54,640
Describe what you're doing, Put your code there, put the error message that the code produces or the

111
00:08:54,640 --> 00:08:55,360
output.

112
00:08:55,930 --> 00:08:59,650
If it's an output and maybe you're not expecting that output.

113
00:08:59,650 --> 00:09:07,000
And then here, describe what output you expect so that others know where they can help you and then

114
00:09:07,000 --> 00:09:08,260
ask the question.

115
00:09:09,710 --> 00:09:10,550
And that's it.

116
00:09:11,120 --> 00:09:16,160
So that's about asking programming questions and that's about StackOverflow.

117
00:09:16,430 --> 00:09:19,100
You can ask a question if you like.

118
00:09:19,130 --> 00:09:22,060
Also in the Q&A inside the code.

119
00:09:22,070 --> 00:09:26,950
So again, the same structure would be recommended in the Q&A.

120
00:09:26,960 --> 00:09:32,330
Inside the course, you also have this highlighting feature, so please highlight the code.

121
00:09:32,360 --> 00:09:35,810
It's easier for people to read it on StackOverflow.

122
00:09:35,840 --> 00:09:43,940
You'll probably get answers quicker because there's a big number, thousands of people online all the

123
00:09:43,940 --> 00:09:46,790
time here, so that makes sense.

124
00:09:46,790 --> 00:09:47,850
So thanks a lot.

125
00:09:47,870 --> 00:09:49,010
I'll see you later.

