lies about OOP
Adam DePrince
adam at cognitcorp.com
Wed Dec 15 23:53:59 EST 2004
On Tue, 2004-12-14 at 18:27, Roy Smith wrote:
> Terry Reedy <tjreedy at udel.edu> wrote:
> > I did not really 'get' OOP until after learning Python. The
> > relatively simple but powerful user class model made more sense to
> > me than C++. So introducing someone to Python, where OOP is a
> > choice, not a mandate, is how *I* would introduce a procedural
> > programmer to the subject. YMMV.
>
> OOP is a choice in C++ too. You can write procedural C++ code; no
> need to use classes at all if you don't want to. Something like Java
> is a different story. Java *forces* you to use classes. Nothing
> exists in Java that's not part of some class.
>
Static methods act like C functions. Sure, they are members of classes,
but in name only. Besides, just as you can use a procedural language in
an OO fashion with enough programmer discipline, you can write in a
procedural style with an OOP language with sufficient rebellion. Just
use one class, put everything in it and create one instance on startup.
Now that I think about it, Java is an exception to this. There are per
class code and variable limits in the JVM, limiting the size of your
procedural program masquerading as a class. Perhaps that is a good
thing.
Adam DePrince
More information about the Python-list
mailing list