Master The Art of Object Oriented Programming through Crio.do

Meet Shah
4 min readJul 31, 2020
Photo By Shutterstock

As an aspiring software developer, I always used to worry about technical interviews and specifically OOP concepts as one needs to have a clear understanding of applying OOP concepts during technical rounds and interviews. But through #IBELIEVEINDOING challenge by Crio.do I was privileged to learn and understand OOP concepts and also apply them to real-world products.

If you ask me to explain OOP concepts in one line:

Hiding Data — Encapsulation

Hiding Complexity — Abstraction

Reuse Existing Functionality — Inheritance

Same Signature Different Actions — Polymorphism

Okay! I know now you are curious to deep dive into understanding object oriented programming concepts :D
Let’s deep dive then!!

Encapsulation:

Data duplication is a huge issue but why do we have to worry when we have encapsulation which reduces data duplication. Making variables private makes it protected from outside direct access and then using those private variables in the public functions defined inside the class helps get the job done, as all we need to do is call the required public method of the class and the variables are private so direct access is denied but the required functionality is performed by calling the function using an object of that class providing data hiding. Also if we are given to add more and more validation constraints and functionalities, we no longer need to write duplicate codes for different handlers instead we can write the logic in the public function of the class and then call the same function from both the handlers so data maintainability is achieved.

Data Hiding ✅

Data Maintainibility✅

Abstraction:

I would consider abstraction to that famous Hindi proverb “aam Khao gutli matt gino”

Implementation is private which hides the underlying complexity of data. Consider this — what if every time you use scanf() in C, you as a user had to know the underlying understanding of how scanf works or how it takes input! Scary!? All we do is import header files where the basic implementation is done which we neither see nor do care unless we are a system administrator working on a project for C.

Repetitive code is avoided. Let’s just say abstraction is an extended version of encapsulation wherein capsulation we incorporated similar or closely related fields in a class or an object, here in abstraction we only expose those methods which are necessary for the user :D

Flexibility achieved

So if someone asks me how is oop concept like abstraction achieved in C?

Header files are a classic example :)

Inheritance:

If the parent class has defined the important methods, let the child class enjoy its benefits :D

Inheritance helps separate common functionality so that they can be reused across other classes providing code reusability and code maintainability.

Implements the DRY (Don’t Repeat Yourself) Programming principle.

The best example is how WhatsApp sends message functionality where we have an option to send emojis, audios, text, etc. So here the sender and receiver details are common, right?

Let that be a base class and then we create text class, emoji class, and audio class where we extend the base class and use it accordingly. Inheritance provides clean class structure and maintainability of code is improved :D

Polymorphism:

I have one name but different forms

I inherit my parents’ property but also believe in overriding it for the betterment

Who am I?

I am Polymorphism where I basically deal with Method overriding and Method overloading

Polymorphism presents the ability to perform different tasks using the same method signature making the code much more cleaner and improves code maintainability as well.

It is applied by overriding or overloading methods in the parent class from the child class. Maintenance of code becomes much more difficult if we don’t use polymorphism as some changes would correspond to changes in all of dependent/client code.

I hope you have now understood all the object oriented concepts. If you also wish to learn and enhance your computer science concepts like me,there is no other better platform than Crio.do because at Crio learning happens by doing :)

#IBELIEVEINDOING

THE BEST WAY TO LEARN COMPUTER SCIENCE CONCEPTS IS TO LEARN BY DOING IT AND IMPLEMENTING IT.

We are always being told that you don’t master a concept until you don’t apply it. I can confidently say that no online course/platform makes you understand or implement the core computer science concepts better than CRIO.Do.In this era where ed-tech is emerging at a great pace, I believe Crio stands out as a great edtech learning platform because it implements industry practices and standards and makes you learn code or any technical aspect by actually coding it :)

Follow my journey as a tech enthusiast on Instagram: dailytechbymeet :)

--

--