Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is programming with objects not considered procedural?

Tags:

c++

c

oop

Even though OOP uses objects and data encapsulation, the code still writes out like a procedure. So what makes OOP loose the procedural label? Is it just because it is considered "high-level"?

Thank You.

like image 756
T.T.T. Avatar asked Jul 15 '10 16:07

T.T.T.


3 Answers

It's not that Object-orient Programming is "non-Procedural"; it's just that the code we call "Procedural" is not Object-oriented (and not Functional and probably not a couple others)

It's not so much an either-or case, but a slow gradiate:

Spaghetti code -> Structured Code -> Object-oriented code -> Component code.

(UPDATE: Removed "Procedural" from the chart above, since it refers to all of the right 3/4rds of it)

like image 101
James Curran Avatar answered Nov 07 '22 21:11

James Curran


In theory OOP and procedural programming are orthogonal concepts. The fact that they so intertwined in practice is probably more coincidence than anything else. Because it is so familiar, procedural syntax is the most human readable format around. Message-passing, functional computation expressions, and various other formats -- because of their unfamiliarity -- are simply not as easy for most programmers to work with. Couple this with the fact that most OOP systems are based on extensions to procedural languages, and it becomes pragmatically difficult to separate the two paradigms. (As a side note: That's one of the things I like about F#; as a multi-paradigm language, it helps conceptually separate the various aspects of OOP, imperative programming, functional programming, while making all of them available.)

like image 27
TechNeilogy Avatar answered Nov 07 '22 20:11

TechNeilogy


I would say object-oriented and procedural are orthogonal concepts. Many popular object-oriented systems are extensions of procedural languages, but not all. For example, Dylan reads like a blend of functional and object-oriented programming.

like image 28
Ken Avatar answered Nov 07 '22 19:11

Ken