| " But programming in objects -- true OOP - does not require a language that provides objects. " 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 ;-) ) |
Yes, you can refactor in lots of ways. Some rely more on OOP, some on FP, some on rules-based or constraint-based programming, etc. This is my point -- the tools are there regardless of the language features. Some languages just make this easier or more difficult. No mysticism required :)
Objects are a useful abstraction at times, but "object" does not and should not map directly to some language feature. If you think that then perhaps you've done a great job of learning a language and not-so-good-a-job learning OOP.
As fas the "people who've done only OOP" part? I take it you mean me? Dude I've only been doing functional programming in F# for the last couple of years or so. Found that my OOP chops came in very handy with data structures and functional composition. But perhaps you didn't mean me. I'm not sure.
I'm done here. The only reason I took this thread deeper is that there is a useful thing for HN'ers to learn. The tool is bigger (and more useful) than the language. Don't confuse the concept with the application.