In this article series i am going to discuss common concepts of Object Oriented Programming called OOP. We will compare OOP techniques & concepts with the real world, so it will be easy to understand for novice or even professional programmers.
What is Procedural Programming?
Procedures, also known as routines, subroutines, methods, or functions simply contain a series of computational steps to be carried out. A procedural programming language provides a programmer a means to define precisely each step in the performance of a task. The programmer knows what is to be accomplished and provides through the language step-by-step instructions on how the task is to be done.
Procedural programming is often a better choice than simple sequential or unstructured programming in many situations which involve moderate complexity or which require significant ease of maintainability.
What is Object Oriented Programming?
OOP or Object Oriented Programming is a good programming practise to create manageable projects more easily. OOP gives you facilities to create reusable objects that you or other developers can use in their projects without reinventing them again and again.
An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. In OOP, each object is capable of receiving messages, processing data, and sending messages to other objects and can be viewed as an independent ‘machine’ with a distinct role or responsibility. The actions (or “operators”) on these objects are closely associated with the object.
The most important distinction is whereas procedural programming uses procedures to operate on data structures, object-oriented programming bundles the two together so an “object” operates on its “own” data structure.
Where it comes from?
Objects as programming entities were introduced in the 1960s in Simula 67, a programming language designed for performing simulations, created by Ole-Johan Dahl and Kristen Nygaard of the Norwegian Computing Center in Oslo. (They were working on ship simulations, and were confounded by the combinatorial explosion of how the different attributes from different ships could affect one another. The idea occurred to them of grouping the different types of ships into different classes of objects; each class of objects being responsible for defining its own data and behavior.). The ideas of Simula 67 influenced many later languages, especially Smalltalk and derivatives of Lisp and Pascal. The Smalltalk language, which was developed at Xerox PARC (by Alan Kay and others) in the 1970s, introduced the term object-oriented programming to represent the pervasive use of objects and messages as the basis for computation.
More recently, a number of languages have emerged that are primarily object-oriented yet compatible with procedural methodology, such as Python and Ruby. Probably the most commercially important recent object-oriented languages are Visual Basic.NET (VB.NET) and C#, both designed for Microsoft’s .NET platform, and Java, developed by Sun Microsystems.[who?] VB.NET and C# both support cross-language inheritance, allowing classes defined in one language to subclass classes defined in the other language.
Article by Hasan Hameed