CSC/ECE 517 Fall 2011/ch1 1e sa

From Expertiza_Wiki
Jump to navigation Jump to search

"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

Block-structured programming languages are task-centric, high-level languages. Operations on data sets are emphasized rather than the data itself in an attempt to logically organize program operation. The design and implementation involves breaking down the problem into discrete blocks, or units, which can be nested to any depth or not at all. Each block generally consists of a set of delimiters such as braces, indentation, and the like that separate them from other blocks. Each of these blocks contains a set of (optional) declarations and logic to solve a particular problem. Declarations inside of nested blocks introduces the concept of variable scope, which frees the programmer from having to worry about name collisions and other variable maintenance tasks.<ref>Block (programming) at Wikipedia</ref>

History

Block-structured languages were first conceived in the 1950s with the advent of ALGOL, one of the first imperative programming languages. An evolution of block structuring was created as the “GOTO” logic of programs became more and more difficult to understand and maintain. In 1968, famed computer scientist Edsger Dijkstra wrote a letter and follow-up article on the ideas and motivation behind “structured programming,” where the program exhibits “separation of concerns,” single point of entry but multiple points of exit, and ideas of data structures. It was Dijkstra’s and others’ which helped propel this basic idea of block structure programming into the mainstream.<ref>Structured programming at Wikipedia</ref>

Programming languages

Block-structured programming languages dominate the general purpose, imperative programming language arena. Indeed most programming languages in modern use enjoy some of the benefits of block structure with grouping of code and scope of variables. Indeed, ignoring their object-oriented aspects, all of C, C++, C#, Java, PHP and Visual Basic – for example – contain elements of block structure.

Object-oriented structure

Definition

Description

Principles

Encapsulation
Inheritance
Polymorphism

History and transition

Programming languages

Structure comparison

Advantages, disadvantages, and limitation

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.

Effectiveness and durability

Applicability between paradigms

See also

References

<references/>

Further reading

External links