It is truly understandable that learning programming and writing to code can be totally frustrating and overwhelming. But, let me assure you that it's totally worth it. The right way to learn programming is to just jump into a project(you'll find plenty of step by step tutorial videos online) without thinking anything about it and complete the project even though you don't understand anything you just did. And then figure out what you have just learned piece by piece since now you have the visual recognition of all those concepts they talked about. I'm sure if you repeat it for couple of projects you'll have higher self-confidence to dive deep more into the world of programming.
In this piece I have compressed the concepts of Object Oriented Programming(OOP) to it's simple form as possible. So, what is Object Oriented Programming(OOP)? OOP is simply a set of rules or programming techniques to design computer programs. Programs that are written in objects(data fields) which contains classes(methods) to describe the object's behavior. Confused already? I have described classes and objects below in a more simple and understandable way. So, let's continue. OOP is programming based around classes and instances of those classes(OBJECTS). OOP revolves around how classes interact and directly affect one another. Concepts of OOP are Abstraction, Encapsulation, Inheritance and Polymorphism (these are very important terms).
It is a blueprint of what we want to do. Example: Consider an urban planner Mr. X, who is given the contract to plan and build two bedroom house. Urban Planner prepares a blueprint for building a house containing two bedrooms. With the help of blueprint urban planner can develop as many concrete houses as he can. These concrete forms are called object of a class(Blueprint was acting like a class showing what a house should look like).
Objects are basically comprised of three things, State + Behavior + Identity. Considering an example of a hammer. State - the look of a hammer. Behavior - Hammer is used to hit nails. This is the behavior of hammer. Identity - Each hammer is different. There can be smaller hammer and a big hammer with the same look.
Module can be considered as the collection of the blueprint i.e. classes. For example: Let's say we have blueprints of 2 bedroom house, 3 bedroom house and 4 bedroom house. We would be having separate classes for all three types of bedrooms. Collection of all three blueprints(2 bedroom house,3 bedroom house and 4 bedroom house) is called Module.
Abstraction is the technique for managing complexity by separating interface or interaction details away from lower level implementation details.
Encapsulation infers two meaning:
For example: To protect a garden from the damage that can be caused by public/animal's, owner hired a guard. Now the guard will be protecting the garden from the reach of public and animals.
For example: Let us consider we have a data(int x), which can be changed only with the help of write() function. No external function can access variable x, except for write(). Now if the request to change value of variable x is given and passed by write() function, the value of X would be changed.
Inheritance is the ability to reuse the code. It can be considered as extending functionality of one class to other.
It means many types or many behavior. In other words , the ability to appear in many forms. IT refers to the language ability to process. More specifically, it is the ability to redefine methods for derived classes.
Sources:
• http://www.cs.cornell.edu/courses/cs3110/2018sp/l/07-modules/notes.html
• https://bhawnarya.wordpress.com/2016/02/18/oops-concepts-from-an-eye-of-qatester/
•https://stackoverflow.com/questions/1031273/what-is-polymorphism-what-is-it-for-and-how-is-it-used
• https://medium.freecodecamp.org/object-oriented-programming-concepts-21bb035f7260
• https://www.webopedia.com/TERM/P/polymorphism.html