Instructor: 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 developed 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, they're closer to machine language.
And other programming languages
are higher level than others,
that is, they're 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.
Okay, that's great.
We have these pieces, but what are we missing here?
I mean, if I wanna 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 zero so that 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's going to just start shouting at the computer.
That'd 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,
reads the entire file all at once,
and then translates that to machine code.
So again, interpreter goes line by line,
and each line executes an instruction.
A compilers 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 gonna 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 ran 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 wanna 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 gonna show you how to do that.
I'll see you in that one.
Bye-bye.