0% found this document useful (0 votes)
12 views

OOP Introduction & Advantages

The document introduces object oriented programming (OOP), explaining that OOP uses objects and classes rather than just functions and procedures. It provides an example of a hand to explain classes and objects, and discusses how OOP allows programmers to create modular and reusable code. The document also compares procedural programming to OOP, and lists some key advantages of OOP such as modularity, abstraction, and modeling real-life scenarios.

Uploaded by

nazarmudassar511
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

OOP Introduction & Advantages

The document introduces object oriented programming (OOP), explaining that OOP uses objects and classes rather than just functions and procedures. It provides an example of a hand to explain classes and objects, and discusses how OOP allows programmers to create modular and reusable code. The document also compares procedural programming to OOP, and lists some key advantages of OOP such as modularity, abstraction, and modeling real-life scenarios.

Uploaded by

nazarmudassar511
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Introduction: Object Oriented Programming

Instructor: Engr Shahid Wazir

What is OOP?
OOP is a design philosophy. It stands for Object Oriented Programming. Object-
Oriented Programming (OOP) uses a different set of programming languages than old
procedural programming languages (C, Pascal, etc.). Everything in OOP is grouped as self-
sustainable "objects". Hence, its gain reusability by means of four main object-oriented
programming concepts.

To clearly understand the object orientation model, let’s take your “hand” as an example. The
“hand” is a class. Your body has two objects of the type "hand", named "left hand" and "right
hand". Their main functions are controlled or managed by a set of electrical signals sent
through your shoulders (through an interface). So, the shoulder is an interface that your body
uses to interact with your hands. The hand is a well-architected class. The hand is being reused
to create the left hand and the right hand by slightly changing the properties of it.

Why OOP!
Object Oriented Programming refers to a programming methodology based on objects,
instead of just functions and procedures. These objects are organized into classes, which allow
individual objects to be group together. Most modern programming languages including
Java, C++, and PHP, are object-oriented languages, and many older programming languages
now have object-oriented versions. One of the principal advantages of object-oriented
programming techniques over procedural programming techniques is that they enable
programmers to create modules that do not need to be changed when a new type of object
is added.

Classic “procedural” programming languages before C++ (such as C) often focused on the
question “What should the program do next?” The way you structure a program in these
languages is:

1. Split it up into a set of tasks and subtasks

2. Make functions for the tasks

3. Instruct the computer to perform them in sequence


With large amounts of data and/or large numbers of tasks, this makes for complex and
unmaintainable programs.

Consider the task of modeling the operation of a car. Such a program would have lots of
separate variables storing information on various car parts, and there’d be no way to group
together all the code that relates to, say, the wheels. It’s hard to keep all these variables and
the connections between all the functions in mind.

To manage this complexity, it’s nicer to package up self-sufficient, modular pieces of code.
People think of the world in terms of interacting objects: we’d talk about interactions between
the steering wheel, the pedals, the wheels, etc. OOP allows programmers to pack away details
into neat, self-contained boxes(objects)so that they can think of the objects more abstractly
and focus on the interactions between them.

Advantages of OOP:
 OOP provides a clear modular structure for programs.
 It is good for defining abstract data types.
 Implementation details are hidden from other modules and other modules has a
clearly defined interface.
 It is easy to maintain and modify existing code as new objects can be created with
small differences to existing ones.
 Objects, methods, instance, message passing, inheritance are some important
properties provided by these particular languages.
 Encapsulation, polymorphism, abstraction are also counts in these fundamentals of
programming language.
 It implements real life scenario.
 In OOP, programmer not only defines data types but also deals with operations
applied for data structures.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy