Do you know how a programmer communicates in a program with memory or ram,
find out the answer in this video.
My name is Tim Buchalka from the Learn Programming Academy.
And in this video, you'll learn how a programmer communicates in a program with memory or ram
as well as some other programming fundamentals.
So we'll talk about some programming fundamentals that are typically found
in every programming language,
so knowing about them will help you to apply them in any programming language you may want to learn.
Even if you're not planning on being a programmer,
this familiarity will help you better understand
what programmers need to do to have the computer serve up
a very fascinating games and applications.
Just as every spoken language, English, Spanish, French,
German etc. has its own language grammar syntax,
so does every programming language.
Starting with the basics of most programming languages,
concepts of variables, constants, arrays
and objects are the building blocks for that language.
Each of these four concepts are ways in which a programmer
reserves memory, ram to be used in the program to store data.
Why is there typically four different ways to reserve memory?
Well, to keep it simple it really helps the programmer
to better utilize the computer's memory resources
as well as help the humans who read and write the program
to more quickly understand the purpose for reserving the memory.
Variables are generally used to store data
that can change during program execution.
Constants are generally used to store data that cannot change
during program execution.
Arrays are used to store a list of similar type of data,
for example a list of student names who are taking a course.
Objects are used to store characteristics and behaviors
of a specific thing where a thing can typically be a person, place or thing.
For example, an airport such as Heathrow in England
has certain characteristics as well as certain behaviors such as boarding people,
aircraft taxiing, aircraft takeoff,
aircraft landing etc.
Each variable constant etc. that the programmer
uses is given a symbolic name in the program
and that name should conform to best practice
for the specific programming language being used.
A generic best practice for names is to use names that intuitively
identify the kind of data that the variable constant etc. is storing in memory.
For example, if I want a program to store two numbers
and add them together to produce a result,
then I could create three variables naming them first number,
second number and result number.
Keeping this explanation simple, these three named variables
will reserve three different memory locations to hold the two numbers to be added
and the third memory location to store the result of adding the two numbers together.
Two important aspects of what I've shared so far is that one
notice the symbolic names can actually include multiple words
such as first number, second number etc.,
but there can be no whitespace or blank space
between the multiple words because the language compiler
will think each word is a symbolic name for a memory location,
hence we remove the whitespace between multiple words symbolic names.
Make sense? It's a bit strange, but programmers are very used to it.
The second aspect to notice
is that because the programmer uses symbolic names to reserve
these three memory locations, the program is more generic
so that every time the program's executed,
different actual number values 658,
2978 etc.
can be stored in those symbolically named memory addresses
to produce a completely different result when added together.
That's the beauty of symbolic names for memory addresses.
One final thought which might help further clarify this
is to equate a variable constant array or object symbolic name
as the address or location in memory
like a home or apartment address and each address can store data
in that memory location much like people live in a specific home or apartment.
A bit of a stretch, but sometimes it helps to try to visualize such concepts
with real world examples.
I'm sure you know that 2 + 3 equals 5.
But did you know that Tim plus a space plus Buchalka equals Tim Buchalka.
Find out how that's possible in the next video. Check it out, and thanks for watching.
This is the part of the video
where I meant to get all enthusiastic and to ask you or quite literally
beg you to subscribe to my channel and to like the video and leave a comment and all that stuff.
Well, I'm going to leave that decision in your capable hands
to decide whether I've earned a like or a subscriber or a comment.
I'd be grateful if you do one both or all three.
More videos will get out there in front of a bigger audience if I get that level of engagement,
but obviously it's your choice.
So remember that this series was meant to be watched in order.
So if you haven't watched from the start, then how dare you watch my video series
out of order.
Click the link over here to get to the first video in the series and watch that
if you want to see the entire series in order
or come over here and click to view the previous video in the series again your choice.
All right. I'm done catch you in the next video.