OOP...**P?

Started by
20 comments, last by Dmytry 19 years, 7 months ago
Quote:Original post by Dmytry
Yes. Both is pretty OOP - ish.
Except that second one have alot better implementation hiding.
Just wanted to point out that the Win32 API is implemented something like this. It's object-oriented, but provides a purely procedural interface (since C was the language of choice when it was developed & published).
Advertisement
Quote:Original post by Oluseyi
@petewood:
A more useful retort would have been to point out that procedural functions that act on data require that data to be specified.

wow, that's most perfect explanation what's OOP is i ever heard in my life!

Yes,it's all is about limiting side-effects, like, functional languages have no side effects. Procedural have side effects, if you write in OOP you're specifiing what side effect you do make. Some languages force you to do that, some don't.

edit: and before someone will say something about inheritance, inheritance it IS implementation details that can be hided behind that model. You may have function Close(THandle handle) that can be used to close window ,close file, close door, and that is , it's the same as if you have inheritance and that things derives from parent named "closeable" that have virtual function "close".

as about WinAPI, almost any good system API is done in that way, when it's reasonable (except, say, OpenGL, that instead lets you to select current "thing" once for several commands, i think it's good for performance)

This topic is closed to new replies.

Advertisement