What is the difference between Object-Oriented Programming and Procedural Programming? What are the advantages and disadvantages of each?
OOP: - Objects communicating with each other . Procedural Programming : - Function communictaing with each other (calling each other ) -- I think one of the most OOP Advantages is Abstraction. ie : you are programming in general NOT to a special perpose ex :For a class "car" : You're not programming for the red car from the xxxx manufacturer company ...etc , You are programming for all cars .which they share in many attrinutes ... So I think when you're programming a special thing for special perpose you could use Procedural programing but when you need generality you should use OOP -- Other advantage of OOP is : Modularity: The breaking up of something complex into manageable pieces -- another one is Inheritence ... ex : when you program the car class and the truck class .... there is some common things between them so you could make another class named :vehicle and make them exteds it . so OOP makes it easy to maintain and modify existing code as new objects can be created with small differences to existing ones. -An advantage of Procedural Programming : Needs less memory. -A Disadvantage of Procedural Programming : **** Difficult to relate with real world objects. **** You don't concentrate on the data as much as you do on the operation between them , and in the OOP There is data and oooooonly data .... when you know how to define the object in a right way then you're program is finished ! at the end I think you choose what to ust (PP or OOP ) depending on the programming language for me , I'm using java at most so I have to use OOP I don't know perl , It includes OOP but I don't know any one using OOP with it ..... anyway it's my viewpoint, maybe others would disagree with me :)
Join our real-time social learning platform and learn together with your friends!