|
![](/i/fill.gif) |
Am 23.04.2012 15:43, schrieb Invisible:
> I love how 5.5 added "OOP", which consisted of letting you use the
> keyword "class" instead of "record", and letting you write your function
> code inside a class instead of outside it. I spent ages trying to figure
> out what advantage that gives you. And of course... IT DOESN'T. It's no
> different. In particular, IT'S NOT OOP.
>
> It would have /actually/ been OO if it had let you make fields private,
> or if it supported dynamic binding. But noooo... :-P
There is no language that "is OOP". OOP is a software design approach;
An OO language (or OO language feature) is one that helps you implement
such a design, but nothing more.
Bundling record data and related functions (aka methods) in a single
thing called "class" does help you write software that makes use of data
encapsulation (an OOP concept); it doesn't help you with enforcing the
rules of encapsulation, but it simplifies the syntax by (1)
automatically passing the ubiquitous "this" pointer, and (2) adding new
namespaces to avoid naming collisions. As such, it does qualify as an OO
language feature.
BTW, I'm not sure whether they added any new syntax features to classes
from 5.5 to 6.0, but AFAIR 6.0 *did* support polymorphism; I think the
"Turbo Vision" framework made excessive use of it.
Post a reply to this message
|
![](/i/fill.gif) |