On 06/08/12 01:22, Steven D'Aprano wrote:
On Sun, 05 Aug 2012 20:46:23 +0100, lipska the kat wrote:

<rant>
Object Oriented programming is a mindset, a way of looking at that
particular part of our world that you are trying to encapsulate in
computer language. The language you use is (should be) irrelevant.

That depends on how you define OOP, and in particular, which aspects of
OOP your language supports.

The clue is in the name 'Object Oriented' ... anything else is (or should be) implementation detail.

[large snip]


In particularly, terminology varies -- I personally despise with the heat
of a thousand suns the terms "instance variable" and "class variable" for
attributes or members.

This is an implementation detail and describes the difference between certain types of attributes. A class variable is static and can be accessed without instantiation an instance variable is accessed via an instance ... again the clue is in the name.

Since a "string variable" is a variable holding a
string, and a "float variable" is a variable holding a float, an instance
variable should be a variable holding an instance, and a class variable
should be a variable holding a class.

Class variable and instance variable are higher level abstractions.

The ONLY concept that you should never try to encapsulate is/are human
beings or their aliases.

snip

Is this some sort of mystical "humans aren't objects, they're SPECIAL!!!"
rubbish? Because it sure sounds like it.

Can you give some non-religious reasons why you should not implement
human beings or aliases as objects?

You have answered your own question.... I would be glad to debate my assertion at length with you however the 'moderators' are listening.

If not, let me just say that I reject your prohibition and leave it at
that.


Actually it should really be called Class Oriented programming as
classes are the units of encapsulation.

Incorrect. You don't even need classes to have objects. You can have
class-based OOP, and prototype-based OOP, as in Javascript, Actionscript,
Io, and the language which invented the term, Self.
>
http://en.wikipedia.org/wiki/Prototype-based_programming

Interesting article, I withdraw my 'classed based' assertion however the concept of a unit of encapsulation still exists. Where unit of encapsulation is different from a unit of function or method.

I really don't think python is a
good language to learn OO programming, the problem is that Python
doesn't enforce OO so you are never going to learn what is 'OO' and what
isn't.

I think that's exactly why Python *is* a good language to learn OOP,
because you can be productive even while learning. You can start off by
just adding a little bit of OOP syntax to your programs:

Well I'm afraid I can't agree with this. OO is a state if mind (again) you can't successfully be a 'little bit OO' IMHO

response = raw_input("What do you want to do? ")
response = response.lower()  # Look ma, I'm using OOP!

Infantile but funny

snip

I've already managed to write meaningful code but I haven't
invented a single class yet.

And why do you think this is a problem?

A problem? I wasn't aware that I'd stated it was a problem it just underlines my belief that Python, however useful it is, is not the ideal language to learn about Object Oriented software development.

Classes are one possible solution to problems that actually matter. What
matters is the solution, not the mechanism of the solution. "Writing
classes" is just a means to an end (the solution), not the end itself.

I couldn't agree more, the point is that they are a good solution. I learned very early on that there is more than one way to skin a cat. I have never said that Python is a bad language, I LIKE Python. I certainly prefer it to Java for on the fly development and it sure is more fun at times.

There is a book you could try, it's a bit dry and I read it when I can't
sleep, about 30 mins usually does it :-) It's called Design Patterns

snippety snip


In my not-so-humble opinion, the popularity of Design Patterns has a lot
to do with the fact that they are so abstract and jargon-ridden that they
have become a badge of membership into an elite.

Hmm, I feel a rant coming on about elitism ...

snip

and a Facade is just an interface layer.

Well as you seem to be so concerned with terminology I'd have to disagree with you here. An interface (in computing) has any number of meanings, hardware interfaces, software interfaces the HCI etc etc. In some languages an interface is a non functional unit of compilation that describes the methods an implementing class must provide. A facade on the other hand aggregates a number of fine grained operations that often implement the business logic of an application into coarser grained methods that can be called further up the implementation stack. More importantly, what goes on behind a facade can be completely changed without affecting anything that uses the facade thereby enhancing maintainability. (I'm trying really hard not to use buzzwords here).

I could go on but there seems little point.


Learn Python by all means, the interactive mode is particularly fun,just
try and get a good idea of what OO is all about before you start.

As far as I am concerned, any language without an interactive interpreter
is incomplete.

Well possibly.

lipska

--
Lipska the Kat: Troll hunter, sandbox destroyer
and farscape dreamer of Aeryn Sun
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to