Code Reusability

Only available on StudyMode
  • Download(s) : 324
  • Published : June 25, 2012
Open Document
Text Preview
Two major programming paradigms widely used are procedural programming and object-oriented programming (OOP). Both of these styles have some important differences that need to be evaluated when choosing which one to use. This paper will show the similarities and differenced in terms of procedural programming modules and objects in relation with reusability, security (in terms of hiding code), and the passing of data versus encapsulation.

Reusability of Code
Procedural programming modules and objects are similar in that they use most of the same commands to execute their functions and store their data but also are very different. Procedural modules are easier to use for small specific programs that perform specialized functions. Objects are better used for more general operations that show a need for more complex and reusable functions that may require security and hidden code to avoid any corruption or mistakes. Both options permit private and local variables to be declared but modules can use data separate from the module where an object has its within itself and can be accessed only through its own methods when it is called upon by the program around it. A procedural programming is a module, function, or procedure designed for a specific purpose and performs only that one task. For outside programmers looking in these are relatively easy to follow and decipher when looked into. Procedural programming modules are most often written in the order they are intended to be executed with the exception of those called upon again later in the program. Modules of this type are good for reuse in the original program because they were designed for that program, but they are not very good for reuse in programs without extensive modification because they were designed to do one specific task for a particular program. This does not leave much room for any flexibility in the program. Reuse of codes can take the programmer a large...
tracking img