|
Clarification: you don't need an object to do OOP. Here's a wonderful example. Let's say you're in C. You start writing code and continuously refactor as you go along. What most people find is, after a good bit of coding and refactoring, you end up with code grouped in modules with public and private functions, public and private data, etc. You can have data abstraction, encapsulation, modularity, polymorphism, and inheritance -- all to varying degrees, depending on the problem and solution. OOP takes that categorization and set work and makes it part of the language. But programming in objects -- true OOP - does not require a language that provides objects. In fact, it's the other way around: because people programmed in objects, languages started providing that capability. Where folks get lost in the woods is where they think the language features are OOP instead of the conceptual work. Languages are just varying levels of syntactic sugar on top of the core tools. Hope that clears it up for you |
Without getting into some mystical definition of "True OOP" You don't need any OOP to program or design.
"data abstraction, encapsulation, modularity, polymorphism, and inheritance"
None of these things (except inheritance maybe) is specific to OOP. All of them occur in all kinds of languages and paradigms with no objects or "OOP".
As to
" (with C programs) after a good bit of coding and refactoring, you end up with code grouped in modules with public and private functions, public and private data, etc. you end up with code grouped in modules with public and private functions, public and private data"
Sure if you refactor that way.
You could also end up with a collection of rules (as in Prolog) , polymorphic types and functions (as in Haskell), communicating processes (Occam/Erlang) etc with no "OOP" anywhere. (unless you want to claim any and all use of polymorphism or abstraction of any kind is indicative of some kind of all pervading mystical "True OOP" technique. There is no "True OOP" underlying all use of (say) abstraction or polymorphism).
I think people who've done only OO or primarily OO are as bad as people who've never done any OO or rarely do any OO in making outrageous claims.
Grandiose claims opposing or favoring specific subsets of programming technique [ example 1 --> "Are we still using OO?WTF" example 2 --> "Saying are we using OO is like saying are we using Arithmetic" don't stand up to scrutiny.
Objects are a useful abstraction. So are functions, logic staements, relations, processes, polymorphic types .. . Each in its place. (and balance in claims ;-) )