This website completely moved to new platform. For latest content, visit www.programmingposts.com

Search this Site

19 Feb 2013

DIFFERENCE BETWEEN PROCEDURAL PROGRAMMING AND OBJECT ORIENTED PROGRAMMING




 In Procedural languages like ' C ' , all the variables and member functions are defined in a main() method and main() method is called for execution. As main() method is a entry point in a programming language.  The procedural Languages don't provide any security and reusability. Hence, the object oriented programming was introduced to overcome the drawbacks of Procedural Language.

 Then c++ language came into existence, with a object oriented approach. In which the variables, and member functions are enclosed in a special container called ' CLASS ' .

A Class is a user defined data type and it is similar to a structure in a procedural language.
The difference between structure and a class is , the structure contains variable, but the class contains variables and functions in it . And the most important point that is to be noted is a Class can contain a Main() method in it, which makes a language fully Object Oriented. And  c++ is not a fully object oriented , because it contains Main() method outside of the class.

Later the successful Object Oriented language , Java is developed by SUN MICRO SYSTEMS   . In java, the Main() method is inside the Class and the Main() method is declared as  STATIC.
The reason for declaring main as a static is, according to object oriented programming any every function is inside a class and any function cannot be called without creating a object for the class. And if we want to call any of the method without creating object, then it should be declared as STATIC, and hence  main is declared as static and it is called without creating any object for the class and hence it becomes the ENTRY point of the program or application.

And c#(called as c sharp) is a Object Oriented programming Language developed by MICROSOFT CORPORATION. And c# is one of the best programming language provided in .Net framework. c# can be used for developing Console Applications(character user interface or CUI) and GUI ( graphical user interface) applications.