Everything in Python is an object.
And in the next couple of videos, we're going to talk about this idea of op or object oriented programming,
what it is, what it's useful for and why it's such an important topic for us to become great developers.
Now, when I say everything in Python is an object, what do I mean by this?
Well, remember our data types that we've talked about.
If I click run here, you'll see that we have all our data types, but we have this class keyword in
front of it.
And I mentioned previously that this is something that we're going to get into.
Now, everything here is an object because in Python, everything is built by this class keyword.
And we're able to use different methods on our objects like this to perform some actions on them.
So what is an object?
Objects have methods like these and attributes that you can access with the DOT method.
Now, object oriented programming allows us to go beyond what Python just gives us, which are these
data types.
But wouldn't it be amazing if we can create our own and make Python even more powerful?
And using object oriented programming.
And while we're going to learn the class keyword, we're going to be able to do just that so that the
list over here can grow to our own custom objects.
Now we're going to explore this topic of object oriented programming what objects exactly are and what
this class keyword is over the next couple of videos.
But the key takeaway is that we're able to create our own types, our own data types with different
attributes and methods.
Now, why is this useful?
Let's have a look at an example.
Let's say we're working for Amazon.
And Amazon recently decides that, hey, you know what, we're going to have delivery drones that are
going to deliver our customers packages a lot faster.
But we need to code this drone, right?
And up to this point, we've learned that we can do that with basic functions, conditional logic,
and just writing our code on a dot pi file.
But the problem is as code gets bigger and bigger and bigger.
It's not just a one file.
It's not just ten lines of code.
It becomes hundreds and thousands and millions of lines of code divided into different files.
Code gets more and more complicated because we live in a world where technology's everywhere, and programming
something like a drone is quite complicated, especially when it's a delivery drone.
So how can we use object oriented programming to make this code more manageable?
Well, OP is what we call a paradigm.
That is, it's a way for us to think about our code and structure our code in a way that is easier to
maintain, extend and write.
So if we're writing a program about, let's say that does drone delivery, well, we break it up into
small pieces, into little objects that represents the real world.
For example, I might code an object, my own data type, which is the propellers that allow the drone
to fly.
And maybe another developer works on the camera and the vision part of the drone.
Another developer can perhaps create the clause that hold the package.
And then another developer might be able to work on the signaling so that we're able to send signals
from our drone to, let's say, Amazon headquarters and know where all our drones are.
What we're doing here is we're breaking up functionality and data into different pieces that model the
real world into separate objects so that different people can work on different parts, and then we
can just combine them afterwards.
And the beauty is when we want to, let's say, create a delivery system that's not a drone this time.
Well, it's a tank like delivery robot.
We can use the same pieces such as the camera and the claw and maybe the signaling, but we can just
remove instead of the propellers and use the tracks that, let's say tanks use.
And somebody else can code this part.
But we're able to use different pieces, extend functionality from our drone into different objects.
Now, if you still don't understand 100%, don't worry.
We're going to go over this over and over throughout the next couple of videos.
The main takeaway is that OP is a paradigm, a way to think about our code, a way for us to structure
our code so that as it gets bigger and bigger, we're able to be organized because we're not writing
silly ten line codes.
We're writing millions and lines of codes.
Companies like Netflix have thousands of developers that are writing code every single day.
They need a way to structure and organize this code so that it just doesn't turn into complete chaos
and complete spaghetti code.
Let's take a break and learn more about o.P in the next video.