What is a programming language if someone asked you this question, can you answer it?
Programming is simply a way for us to give instructions to computers, we give it an instruction manual
and the computer follows without code, computer programs wouldn't do anything.
You wouldn't be able to move the mouse around on your screen.
You wouldn't be able to Google things.
You wouldn't be able to play Pokemon on your phone.
Right.
I can't just tell my computer what to do.
You see, computers don't understand English or any other human language for that matter.
So what language do computers speak?
Well, they speak in ones and zeros.
All electronics speak that language of on or off, zero or one.
But writing ones and zeros would be gibberish for us, it's hard for us to communicate like that, right?
So humans have devolved programming languages that are in between human language and machine language
that is zeros and one some programming languages are lower level than others.
That is there closer to machine language and other programming languages are higher level than others
that is there closer to English or a human language.
And there are lots of programming languages, you have languages like assembly that is really, really
close to machine code.
You have languages like Python and JavaScript that are really, really close to English.
OK, that's great, we have these pieces, but what are we missing here?
I mean, if I want to find flights to Hawaii, how do we go from here to.
Well, having, let's say, a website, show us a display of all our flights telling the computer to
show those flight information on our screen.
What are we missing here?
Well, we have these programming languages that we usually write on a file such as Python, JavaScript,
maybe even Java, and then we somehow need to get these files that we write into ones and zeros so that
the our machines can understand.
Well, we need a translator, right?
We take our code that we write what we call a source code written in a programming languages, and we
give that to a translator that can understand that language but also understands machine language.
And this translator just translates these files for us.
So what is this translator, it's not really a person, right?
I'm not giving my code to somebody and somebody is going to just start shouting at the computer that
be quite silly.
What is this translator ready to have your mind blown?
Well, it's another program written by a human.
It can either be an interpreter or a compiler now.
Python usually uses an interpreter usually.
And an interpreter, just like a translator, goes line by line through our code and executes our code
on our machine.
Compilers are a little bit different.
They take your code all at once with the entire file all at once and then translates that to machine.
So again, interpretor goes line by line and each line executes an instruction.
A compiler takes the entire file and turns it into machine code.
Now, the differences between these two are a little complicated and beyond the scope of the course.
And don't worry, we're going to come back to this topic.
But I want you to just have this general picture that when we write code, whether it's Python, JavaScript,
Java, C or C++.
What we're doing is we're typing it in a language that is human readable, we're giving it to one of
these translators like an interpreter or a compiler, and these spit out code that are able to run on
our machines.
So to review interpreters, translate line by line and execute the line before going to the next line,
compilers translate all lines of a program to a file usually called a binary and execute the whole file
at once.
Now, in the next video, we're going to talk about this process a little bit more in detail, especially
on how it works with Python, but why did I start with this?
I mean, this is a complex topic.
Most developers, especially if they're starting out, don't even know of this process.
They just know that they write code and then it runs.
So why did I teach this here?
Because in order for us to be able to write Python code, well, I can't just write it anywhere.
Right.
If you went right now to your computer and let's say you opened up a text file like this one.
And you started typing Python code, but for now we don't know Python, so let's just say I want to
go search for Pokemon.
Well, this might be code, we don't know if it is, but I can't just use this right.
I mean, this isn't really python code, but how would my computer know what I'm talking about?
In order for us to start writing Python, we need to download this translation service.
And in the next video, I'm going to show you how to do that.
I'll see in that one.