Wednesday, November 7, 2012

Object Oriented Programming



The programming process has evolved through many phases. The journey started with programmers who would write programs which some how worked without giving any importance to readability of the program. The languages like FORTRAN and BASIC neither enforced any discipline nor were the programmers trained to write user centric programs. The result was unstructured understandable programs susceptible to bugs acting as time bombs like Y2K problem. The major problem was that the programs were not maintainable.

The structured programming techniques did enforce some discipline on the programmers by way of shunning the use of ‘goto’ statements and encouraging the programmers to use ‘easy to read and difficult to write’ style of code statements i.e. choosing long and meaningful names for the variables, functions, procedures, modules etc. The major emphasis was to use block structures in the program. For instance any code enclosed between a pair of curly braces or the pair of begin – end was termed as a block. Pascal and ‘C’ supported blocks like compound statements, loops, functions, procedures, files etc. This technique worked good for hard core programmers who were able to write large and complex programs using structured programming techniques. Unix operating system was written using ‘C’. Then there were always few hard core programmers available in the market.

Nevertheless, the importance was given to procedures as to how to solve the problem at hand. The algorithm development consumed more time of the developer and least importance was given to the data. So, a program was virtually a collection of decomposed components i.e. interacting functions or modules exchanging data and data structures among them. Such data, especially the global data, was vulnerable to inadvertent corruption by the fellow programmers.

The remedy to the above mentioned drawbacks is that we put more emphasis on data and try to create reusable software components. The reusable components can further be combined to get bigger and more powerful software.

For example, in our day to day life we compose bigger objects from smaller objects. The desktop computer is made up many smaller objects like: mother board, RAM, HDD, SMPS, mouse, keyboard etc. We use the services offered by these objects and never bother as to how they work or who made them?

When we look around then we find that we are surrounded by nothing but objects only. You & I, books, pen, paper, laptop etc. are all objects. In fact any real world program has to be a collection objects. A program about a University would involve objects like students, professors, clerks, class rooms, books, chalk, mark sheets etc. Then why not write programs using objects which would be very natural way of creating useful software comprising of interacting objects.

Object Oriented Programming (OOP) is a paradigm shift in programming which defines, creates, and manipulates objects to develop a reusable software. C++ is an imperative language developed to support OOP components and features like: classes, objects, abstraction, encapsulation, inheritance, polymorphism etc.

A. K. Sharma

Thought to ponder...

True education is that destroys narrow-mindedness,
develops equality and ultimately leads to world peace.

Bhagwan Sri Satya Sai Baba

Sunday, November 4, 2012

बस ऐसे ही


अरनब गोस्वामी  की  इंतज़ार लंबी लगती है 
                  बहरे राजनितीगों पर बहस और भी लंबी लगती है 
 लंबी  लंबी बातें सोचता   हुं 
                  खुली आँखों से ये रात बहुत लंबी  लगती है

सुबह  सुबह की भाग  दौड़  लंबी लगती है
                  दिन  के 9 से 5 की  दूरी और भी लंबी लगती है
 लंबी  लंबी क्लास लेता हुं 
                  सियासत से भरी ये नोकरी बहुत लंबी लगती है

तन्खवाह की इन्तेजार लंबी  लगती है
                 इन्क्रीमेंट की पावत और भी लंबी  लगती है
 लंबी  लंबी  डी ए की किश्त लगती हैं
                   मुझे तो ये महेंगाई  बहुत लंबी लगती है

क्रासिंग की बत्ती लंबी लगती है
                   हर  सड़क और भी लंबी लगती है
 लंबी  लंबी यात्राऐं करता  हूँ
                   मुझे तो ये जिंदगी बहुत लंबी लगती है

अशोक

Thought to ponder...

Your very speech should be soft. Not only soft but also truthful.

Bhagwan Sri Satya Sai Baba