Reusability of Code

Only available on StudyMode
  • Download(s) : 208
  • Published : February 28, 2013
Open Document
Text Preview
Reusability of Code
PRG 211
30, July 2012

Reusability of Code
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.

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...
tracking img