Monday, January 5, 2009

Structured and Object Oriented Programming Languages

Check out my blog about engineering salaries.

In this blog I will try to explain engineering terms, which might help

1 Students: Especially engineering.
2 New Graduates: The topics covered in this blog are also common questions in most of the interviews for engineering postions.
Now to the main thing
Difference between Structured Programming and Object oriented programming:
Structured programming was first suggested by Corrado Bohm and Guiseppe Jacopini.
Structured programming also known as modular programming was developed to avoid GOTO statements used in the non structured programming languages before the advent of structured programming languages like PASCAL and ADA. The two guys mentioned above, who were mathematicians actually, showed that any computer program can be written with the use of three things:
a) Decisions: Examples are if ...else statement used in computer programing. A typical structure of any if..else statement is
If (condition) then(action) else(some other action).
b) Sequences: Simply put, it means sequence of statements in any computer program.
c) Loops: Examples are for statements which iterates a certain set of instructions for a specified number of times or until some predefined condition is met.
In brief we can define a structured Programming language as a programming language which
enforces a logical structure on the program being written to make it more efficient and easier to understand and modify.
Lets go to OOP or object oriented paradigm now. In any object oriented programming language like C++ or Java data is the most important thing. It ties data more closely to the functions that operate on it and protects it from unintentional modifications by other functions. OOP allows us to decompose a problem into a number of entities called Objects and then build data and functions around these entities. The combination of data and methods make up an object. Hence OOP can be called an advanced version of structured programming and makes understanding a program much easier. It also makes debugging a program much easier.
Finally a major difference is that OOP is used in software development whereas structured language like C is usually used in hardware programming or for maybe developing a program to interface a hardware with computer.
Different companies have different requirements for programming skills. For example a company like Garmin which is a leading company for the manufacture of GPS navigation system might look for C programming skills whereas a company like Microsoft may look for object oriented programming skills like Java or C++. Nevertheless, its important to know the difference between the two.

No comments:

Post a Comment