With this being my first blog post I'm rather excited. The topic of discussion in this post will be Object Orientated Programming, often abbreviated as OOP. Basically, OOP deals with the manipulation and representation of "objects." A collection of like-objects form a class, which defines the datatype and the methods that can be performed on the objects. In simple terms, a class is just the "blueprint" to build a particular type of object.
Now, a noteworthy concept that arises in OOP is inheritance. Inheritance describes the ability of a class to obtain most or all of its methods from a parent class. Interestingly, all python classes are subclasses of the special class Object. Yet, even more remarkable is that bool is a subclass of int! This may or may not seem peculiar to you depending on your relative background in python and older versions.
Now, a noteworthy concept that arises in OOP is inheritance. Inheritance describes the ability of a class to obtain most or all of its methods from a parent class. Interestingly, all python classes are subclasses of the special class Object. Yet, even more remarkable is that bool is a subclass of int! This may or may not seem peculiar to you depending on your relative background in python and older versions.
Nonetheless, I personally find OOP to be very useful. It enables me to use the concept of a class to define new data types for a variety of purposes. For instance, we could create an endangered animal class that keeps track of the name, species and population of the endangered animal, or a luxury car class that keeps record of the name, colour and price of the car.
I'm definitely looking forward to investigating and learning of further concepts related to classes, including other special methods, multiple inheritance, trees etc. Not to mention that I'm rather excited to learn other object-oriented programming languages, particularly C++, upon mastering python. Overall, OOP is not only efficient and cleaner, but allows the programmer to write beautiful code!!
I'm definitely looking forward to investigating and learning of further concepts related to classes, including other special methods, multiple inheritance, trees etc. Not to mention that I'm rather excited to learn other object-oriented programming languages, particularly C++, upon mastering python. Overall, OOP is not only efficient and cleaner, but allows the programmer to write beautiful code!!