DEV Community

Cover image for What is OOP...?
Yash Shah
Yash Shah

Posted on • Edited on

What is OOP...?

Starting with a basic question...

Why do we need programming..???
✔To design Software Applications that help in solving real-world problems.
alt text

One question More...🧐

How can we handle thousands/millions of lines of code of those complex software applications solving problems...?🙄

So, here comes the Object-Oriented Programming Paradigm...

The object-oriented model makes it easy to build up programs by accretion. What this often means, in practice, is that it provides a structured way to write spaghetti code.
--Paul Graham

Object-Oriented Programming(OOP) refers to the art of decomposing an application into a number of software objects that work together.

What are Software objects?
Take real-world objects to share two characteristics:
1.they all have state and,
2.they all have behavior.
For example, dogs have state (name, color, breed, hungry) and dogs have behavior (barking, fetching, and slobbering on your newly cleaned slacks).
alt text

Software objects are modeled after real-world objects in that they, too, have state and behavior. A software object maintains its state in variables and implements its behavior with methods.
alt text

In a Software Application,
Objects communicate with each other by sending
messages to each other.

For e.g., a Circle object
Data will be a center (x and y coordinates) and the radius.
This object will have methods to be able to set its center coordinates or its radius, and report its radius to other object.

Thus, Object-oriented programming (OOP) is a computer programming model that organizes software design around data, or objects. An object can be defined as a data field that has unique variables and methods.

Top comments (0)