Tuesday, May 5, 2020

Comparison of Object Oriented and Structured Programming free essay sample

Object-oriented programming is the predominant paradigm in the software development world. Thus, it is important to understand how object-oriented programming works. One useful exercise may be to compare and contrast object-oriented programming to more traditional structured programming. I will do just that in this essay. We will review some history, give a brief overview of both paradigms, and discuss how they are similar and different. First it’s important to understand the history of these methodologies. Structured programming is itself an improvement of a more primitive paradigm. As the first computers gave way to more powerful systems in the 50s and 60s, the programs that ran on them became more complex. The Goto statement became very common, as it allowed additional flexibility by transferring control to different parts of a program. However, the overuse of the Goto statement resulted in programs becoming so convoluted as to be unreadable by even expert programmers. We will write a custom essay sample on Comparison of Object Oriented and Structured Programming or any similar topic specifically for you Do Not WasteYour Time HIRE WRITER Only 13.90 / page Such tangled logical sequences became known as â€Å"spaghetti code. † Computer scientists recognized a need for order, and structured programming was the result. They rejected the Goto statement, and instead proposed the three basic control structures that we still use today: sequence, selection, and iteration. They also advocated grouping data into structures the use of subroutines that receive and output data. A closely related subset is Procedural Programming, which incorporates the idea of modularity: creating independent, reusable pieces of code that perform specific functions. The process these computer scientists were engaged in is known as abstraction. Abstraction allows us to add a layer of conceptual meaning to more concrete details. It allows the human mind to better grasp what the program is actually doing. The overall result of this abstraction was improved readability and simplicity of code. With that in mind, we can see that object oriented programming takes abstraction a step further. The object oriented methodology started to be developed around the same time as procedural programming methods, however it took much longer to become the dominant paradigm. Where procedural programming emphasize organizing code based on program flow and logic, object-oriented programming emphasizes the data itself. A brief description of object-oriented programming follows. As I said earlier, OO programming adds another layer of abstraction to our programming methodology. It is a conceptual framework first and foremost, and at its core is the concept of the â€Å"object. † An object can be made to resemble any real world object, such as a person or a bicycle. Just like any real world object, objects in programming languages such as Java have attributes (state) and actions (behavior). These objects are defined by classes, which are templates that define the data and methods an object has. Another key concept in OO programming is the idea of encapsulation. Encapsulation describes the desired goal of related grouping data and methods into objects, as well as the goal of hiding the inner workings of an object from the â€Å"outside. † This is accomplished by creating interfaces to allow other objects to access an object’s data and methods. This framework leads to very different implementation of code, as any programmer who has made the switch from C/C++ to Java knows. The sequential, step-by-step system is replaced by a more dynamic one. To newcomers it may appear more confusing, however, proponents of OO programming claim it actually results in cleaner, simpler and more reliable code. The conceptual framework is closer to how humans think, and thus may help us write better instructions for our â€Å"computation machines. † It’s important to note a few things. One misconception is that object-oriented programming is more advanced than structured or procedural programming. This is not true. Although it didn’t become prominent until the 1990s, computer scientists were incorporating object-oriented features into new programming languages, as early as the 60s. Such as ALGOL 60 and Simula. Another point to be made is that terms such as â€Å"structured†, â€Å"procedural†, and â€Å"imperative,† do not have same definition depending on who you talk to. And none of these techniques are mutually exclusive. Object oriented programming does not stand apart from Structured or Procedural programming; in fact, it incorporates and expands upon the same principles that it’s predecessors are based on. A comparison of object-oriented programming with structured programming would turn up many similarities.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.