‎2008 Jan 27 8:37 AM
what is difference between Procedural programming and Obect oriented programming.
‎2008 Jan 27 8:58 AM
Hi,
Procedural programming
It can sometimes be used as a synonym for imperative programming (specifying the steps the program must take to reach the desired state), but can also refer (as in this article) to a programming paradigm based upon the concept of the procedure call. Procedures, also known as routines, subroutines, methods, or functions (not to be confused with mathematical functions, but similar to those used in functional programming) simply contain a series of computational steps to be carried out. Any given procedure might be called at any point during a program's execution, including by other procedures or itself.
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.
Possible benefits:
1) The ability to re-use the same code at different places in the program without copying it.
2) An easier way to keep track of program flow than a collection of "GOTO" or "JUMP" statements (which can turn a large, complicated program into spaghetti code).
3) The ability to be strongly modular or structured.
Procedures and modularity
Especially in large, complicated programs, modularity is generally desirable. Inputs are usually specified syntactically in the form of arguments and the outputs delivered as return values.
Scoping is another technique that helps keep procedures strongly modular. It prevents the procedure from accessing the variables of other procedures (and vice-versa), including previous instances of itself, without explicit authorization.
Less modular procedures, often used in small or quickly written programs, tend to interact with a large number of variables in the execution environment, which other procedures might also modify.
Comparison with object-oriented programming
The focus of procedural programming is to break down a programming task into a collection of data structures and subroutines, whereas in object oriented programming it is to break down a programming task into objects. Either method can be valid for accomplishing a specific programming task. (Object orientation is often referred to as OO and object oriented programming as OOP.)
The most popular programming languages usually have both OOP and procedural aspects.
Some differences between pure object-oriented languages and non-OO procedural languages:
Because of the ability to specify a simple interface, to be self-contained, and to be reused, procedures are a convenient vehicle for making pieces of code written by different people or different groups, including through programming libraries.
pure OO v/s pure procedural
1) methods 1) functions
2)objects 2)modules
3)message 3)call
4)attribute 4)variable
check this link for more....
http://www.developer.com/design/article.php/3317571
Regards,
Shanthi.P
kindly reward ponits if useful **