My learning journey of Object Orientated Programming (OOP) in Python.
I stumbled onto the OOP paradigm in programming while learning about Data Structures and Algorithms which was the intended new repository I wanted to put up (I'll post this learning journey in a later repository once its completed). However, when I ran into the description on how Linked Lists (Data Structure) are implemented (I believe this is the same for more complex Data Structures like Stack, Queue, Trees) I realised they make use heavily on Python's Class function (making of the 'Node' Class) which I have barely touched upon. Hence, I decided to take this detour to learn about OOP before getting back into learning about Data Strutures and Algorithms. (a very important concept all programmers must know!)
Another thing I found interesting is that out of the many programming languages that exist, many of them are purely (or are made up of a high composition) object oriented and this includes Python (purely object oriented), so everything in these programming language (such as data and its functions) are all essentially, objects (like how you create an object use Python's Class function). Only a few programming language such as C are not object oriented as they still use primitive data types such as ints, floats, char etc, which are data with no attributes or properties (hence not an object/Class).
What is Object Oriented Programming (OOP)?
Object Oriented Programming (OOP) is a computer programming paradigm that organizes software design around data, or objects, rather than functions and logic.
OOP Documentation: https://docs.python.org/3/tutorial/classes.html
Source(s): https://www.youtube.com/playlist?list=PL-osiE80TeTsqhIuOqKhwlXsIBIdSeYtc (Corey Schafer)
The code that I put into the 'Object_Oriented_Programming_(OOP)_learn' folder is taken from and in order of this playlist's contents, covering the following OOP concepts split into the sub-folders:
- Tutorial 1 - Classes and Class Instances
- Tutorial 2 - Class Variables
- Tutorial 3 - Class Method and Static Method
- Tutorial 4 - Inheritance - Creating Subclasses
- Tutorial 5 - Special (Magic or Dunder) Methods
- Tutorial 6 - Property Decoraters - Getters, Setters and Deleters
Source(s): https://pynative.com/python-object-oriented-programming-oop-exercise/ (PyNative)
The coding excercises I put into 'Object_Oriented_Programming_(OOP)_practice' folder is taken from and in order of this website's contents.
Practices done by myself. Solutions that look quite different from my answers (or if my answers are wrong) I have attached the solutions in the folder as well.
My first file using Python's Classes and doing Object Oriented Programming, figured I'll put this simple file here as well (the code in here created a simple 'Car' Class).
A fairly short learning journey, with relatively simple practice done provided by PyNative.
I believe that I have now a better grasp of Python's Class, SubClass, Property Decoratorsand other concepts relating to Object Oriented Programming.
I think to further work on my understanding of OOP I'll probably work on an OOP Python project that I hope to be able to upload it here soon before going to back to the Data Structures and Algorithm learning journey.
Have a gif: