CSC/ECE 517 Fall 2011/ch1 1e sa
"Block and Object-Oriented Programming Languages" by Andrew Davis and Srikanth Ramachandran
In computer science, computer programming languages exhibit variance in syntax and structure in order to effectively solve problems. Two of these variances can be seen between block structure and object-oriented structure. A programming language with block structure allows the programmer to group lines of code so that they may be accessed as a single entity. Meanwhile, object-oriented structure allows the programmer to associate data with its actions in a hierarchical manner. Object-oriented structure has many advantages which generally make it more effective and durable than block-structured languages, but object-oriented languages also benefit from ideas present in block structure programming.
Block structure
Definition
History
Programming languages
Object-oriented structure
Definition
Description
Principles
Encapsulation
Inheritance
Polymorphism
History and transition
Programming languages
Structure comparison
Advantages, disadvantages, and limitation
Block Structured Languages
Advantages:
1. Simplicity. 2. Coding and turnover time is very small. 3. Dynamic lifetime of variables provide efficient usage of memory with allocation and deletion happening at the entrance and exit of each block.
Disadvantages:
1. When arrays are passed as parameters they are usually unbounded,hence it was easy to access an element out of bounds. 2. Large sized projects were very difficult to manage due to very large code bases. 3. There is very less code reuse.
Object Oriented Languages
Advantages:
1.The software objects model the real world objects. Hence the program composition is well defined and structured. 2.Since each object's definition and internal working is decoupled from other objects in the system the design becomes inherently modular. 3.Adding new features becomes very easy because of the inheritance feature. The new class can contain the new feature in addition to all old features from the inherited class. 4.Debugging is easier since each objects internal working is independent of each other. This helps in isolating errors easily and fixing them. 5.Code re usability.
Disadvantages:
1.The complexity of O-O design becomes prohibitive when working on small projects. 2.Object-oriented programming paradigm is preferable for dynamic environments rather than simple non complex environments. 3.The time efficiency is much less compared to block structured languages.