We use cookies to give you the best experience possible. By continuing we’ll assume you’re on board with our cookie policy

Reusability of Code Essay

Reusability of code’s general purpose is to reduce unnecessary coding which in the end reduces project development time and funds. It is essentially taking code from one part of a program and attempting to employ it elsewhere without having to alter too much. This method is similar to reusing software mechanisms in object-oriented programming.

Object-oriented programming and procedural programming are two programming paradigms that distribute common attributes as well as various differences. A procedure is an additional name for a routing, technique or function. Procedures and objects both use algorithms to develop the system and any logical calculation that is necessary for the program. A function is divided from variables and data compositions. Procedures are intended to run the code in a precise order, while OPP merges data with the function in the function changes the data that is bound to it into a unit identified as an object. Other useful features such as abstraction, encapsulation, and inheritance can be achieved while working with OPP.

We will write a custom essay sample on Reusability of Code specifically for you
for only $16.38 $13.9/page

Order now

Procedural Programming

The earliest programming languages were procedural, meaning a program was made of one or more procedures. A procedure is simply a module or function that performs a specific task such as gathering input from the user, performing calculations, reading or writing files, displaying output, and so on. The programs that you have written so far have been procedural in nature. The steps a program must perform to reach the desired outcome. Procedure is an independent entity and a sequence of instructions that are grouped together.

In procedural programming, a task is broken down into assortment of variables and subroutines. In OPP, a task is broken down into objects which summarize the data and execution. In a procedural approach, the entirely called variable is termed as a trait of the object. The idea is to encapsulate data and a technique into what is referred to as a class. A class is a model; a class can be used to make several objects. This allows code be reusable in OPP.

Object-Oriented Programming

Object-oriented programming (OOP) is centered on creating objects. An object is a software entity that contains both data and procedures. The data contained in an object is known as the object’s fields. An object’s fields are simply variables, arrays, or other data structures that are stored in the object. OPP’s group the data methods together so that each can operate on its own data while procedures are used to directly perform operation on data structures.

OPP provides encapsulation making class whose objects can be created dynamically. OPP’s have been observed to give lower quality performance as compared to procedural programming. In addition to solving the problems of code-data separation, the use of OOP has also been encouraged by the trend of object reusability. An object is not a standalone program, but is used by programs that need its service. (Gaddis, 2010)

References
Gaddis, T. (2010). Starting out with programming logic and design. (2 ed.). Pearson Education, Inc.

How to cite this page

Choose cite format:

Reusability of Code. (2017, Feb 18). Retrieved from https://studymoose.com/reusability-of-code-2-essay

We will write a custom essay sample on
Reusability of Code specifically for you

for only $16.38 $13.9/page
Order now

Sorry, but copying text is forbidden on this website. If you need this or any other sample, we can send it to you via email.

By clicking "SEND", you agree to our terms of service and privacy policy. We'll occasionally send you account related and promo emails.

Our customer support team is available Monday-Friday 9am-5pm EST. If you contact us after hours, we'll get back to you in 24 hours or less.

By clicking "Send Message", you agree to our terms of service and privacy policy. We'll occasionally send you account related and promo emails.
No results found for “ image
Try Our service