All language subtitles for 8. Debugging (Fixing Errors)

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

1 1

So we talked about problem solving, 2

2

which is a very important skill of any software developer. 3

3

Now, another extremely important 4

4

developer skill is debugging, 5

5

which means to find and fix errors. 6

6

So let's finish this section by talking about debugging 7

7

to make you ready for the rest of the course ahead. 8

8

So first of all, as you might already know, 9

9

a software bug is a defect or a problem 10

10

in a computer program. 11

11

So basically, any unexpected or unintended behavior 12

12

of a program is called a bug. 13

13

And the actual term bug was coined in the 1940s 14

14

when this real bug was causing an error 15

15

in Harvard's computer. 16

16

Now, there are many reasons for bugs in programs, 17

17

but what matters here is that bugs 18

18

are a completely normal part of software development, 19

19

because we are humans, 20

20

and humans make mistakes. 21

21

In fact, every complex application contains bugs, 22

22

which sometimes go undiscovered for years 23

23

and can cause security holes or other problems. 24

24

So really, don't feel bad if you introduce bugs 25

25

in your own count. 26

26

We all do it, even the most expert programmers. 27

27

Now luckily, not all bugs cause huge security holes. 28

28

In fact, many bugs are quite small 29

29

and simple to discover. 30

30

So let's see a simple example. 31

31

Remember in our previous example, 32

32

the goal was to reverse whatever was passed 33

33

into the function. 34

34

So let's say we finished writing the reverse function, 35

35

and call it with this array and get this result. 36

36

But clearly something is wrong here, right? 37

37

The return value looks scrambled, 38

38

but not reversed at all. 39

39

So this means that we must have a bug somewhere 40

40

in our reverse function, okay? 41

41

To fix this, we use a process called debugging, 42

42

which is essentially finding, fixing, 43

43

and then preventing bugs. 44

44

So let's see how that works. 45

45

So the first step is to actually become aware 46

46

that there is some kind of bug, 47

47

because as I said, in a large application, 48

48

bugs can actually go undiscovered for years. 49

49

Now, discovering bugs usually happens 50

50

during development using automated testing software 51

51

or user reports during production. 52

52

And bugs that are identified during production 53

53

are the worst bugs, 54

54

because it means that they went undiscovered 55

55

during development and are now affecting 56

56

real users of our application. 57

57

So that's why it's really important 58

58

to identify bugs early, 59

59

for example, using automated tests. 60

60

Now, while identifying the bug, 61

61

sometimes we also need to take into consideration 62

62

the context in which the bug happened. 63

63

For example, certain bugs might only happen 64

64

in a certain browser, 65

65

or only for certain users, for some reason. 66

66

Next, once we know there is a bug, 67

67

we need to go into our code and find the bug. 68

68

We need to isolate where exactly it's happening, 69

69

and we can do that using the developer console 70

70

that we already know. 71

71

However, that only works for small bugs 72

72

and simple code where we have a good idea 73

73

where the bug might be located. 74

74

But if the code is more complex 75

75

and we have no idea where the bug might be, 76

76

then we need to use a debugger software. 77

77

And I will show you how that works in the next video 78

78

because it's really important for developer 79

79

to be able to use a debugger. 80

80

Anyway, once we know where the bug is located, 81

81

we can finally fix it so we can correct the bug. 82

82

And this is probably the easiest part. 83

83

So essentially, all we need to do 84

84

is to replace the existing, so the wrong solution, 85

85

with a new correct solution that actually works. 86

86

As a final step, we should then prevent this bug 87

87

from ever happening again in our code base. 88

88

For example, we can search our project 89

89

for the same bug in similar code, 90

90

like in a similar function. 91

91

It's totally possible that we did the same mistake 92

92

twice in our code, 93

93

and if that's the case, 94

94

we must fix the bug everywhere. 95

95

A more advanced way of preventing bugs 96

96

is to write tests using testing software. 97

97

And I might add a bonus section on testing 98

98

to the course at some point 99

99

because this is actually an important part 100

100

of software development. 101

101

Okay, and that's it. 102

102

That's a broad overview of debugging in programming. 103

103

And we really just scratched the surface here, 104

104

because you're still at the beginning of the journey. 105

105

And so this is just an introduction. 106

106

Anyway, let's now fix some bugs in the next video.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.