Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranî)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
Welcome back and now I'm going to tell you a little bit about the main reasons for using constants,
because you may be wondering for yourselves as to why we even need them, right?
Because that's not quite understandable, just to say that they are constant and that's it.
OK, there are a lot of additional reasons and some of them I will cover up in this video.
So you may be you may be thinking to yourself that we've been doing pretty well also with just using
the variables, so why do we even need these constants for?
I will tell you some of the reasons, but maybe and don't worry so much about it, maybe at this point,
not all of them will seem to be like 100 percent clear to you.
And that's OK, because most of them, most of the reasons are considered to be for quite a higher level
programming courses.
But I think that's something you must be familiar with, at least in my course, to be familiar with,
not to implement everything regarding do, but at least to be familiar for these three main reasons.
So with that being said, let us start and discuss the main reasons to use constants and domain ideas
that I see for when and where you should consider using them.
All right, so reason number one for using constants use performance so the compiler can perform certain
optimizations for using loops as well as the usage of inline code.
OK, also creates an object code that is parallelism friendly.
That means simply if you are planning to develop complex applications and not just basic applications
like we've we've seen that can be made, especially at the beginning of the program, at the beginning
of the course.
So basically, if you're planning to develop complex apps, I mean, like really complex applications
with massive amount of, ah, commands and utilizing high CPU usage, a lot of commands, and basically
you may want to do it in a parallel manner, splitting the processing and so on, then using constants
will assist you with that.
So that's reason number one and I'll let us talk about reason number two, and this reason is called
defense.
So using constants allows basically allows you to protect yourself from accidentally changing values
when you are not supposed to.
So it gives you another layer of protection by basically when you have some functions, when you have
some program, when you when you know that some value should not be changed over time and during the
execution or during some function.
And you will specify these information that it's a constant and it should not get changed.
So that this way, even if you've done some mistake, even if you modified it by mistake, I don't know
or you forgot about it or something like that, then the compiler before the program will be built and
run, the compiler will notify you that, hey, listen, you tried to change here, these value of this
variable, but it's supposed to be constant.
So please check it out again.
OK, so that's another another layer of defense.
OK, another layer of protection to make sure that your values that are supposed to be constant are
not changed by mistake.
Okey dokey.
And finally, regarding the third reason, reason number three is code readability.
OK, so when reading the code and sometimes there are me maybe so many lines of code, it's a good practice
to use constants to specify the exact variables that, you know, they should not get changed.
So that gives you a good understanding for the fact that you are using a constant variable, since you
know that it's only defined here with its given value and it's not going to get modified during the
execution of the program.
And that's opposed, of course, to the standard variable that may change during any line of the program.
And you have like to take a closer look and see where and how it's being used.
So that's the third important reason that I wanted to tell you regarding the usage of constants in your
program, in your development process, or basically when your exams, of course, you may also let
me know if you find any additional.
Of course, there are additional reasons for using constants, but I think that I just took they are
most relevant in my opinion.
Of course, you may also add additional ideas, additional reasons for why you consider using pointer
are constants.
And yeah.
So as always, guys, thank you so much for watching.
Keep on practicing.
Keep on betting, getting better.
And actually you're bound to succeed if you do it correctly.
Hopefully so.
Thank you guys for watching.
My name is Vlad.
These are an important video.
And until the next time, until the next video or section or whatever it may be, have a great time.
I'll see you then.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.