Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

OO patterns with Python

1 view
Skip to first unread message

Patrick Useldinger

unread,
Feb 10, 2003, 2:42:43 PM2/10/03
to
Hello all,

I am an "experienced" programmer, but as I've worked on mainframes for the
last 13 years I never had the opportunity to experiment with OO. I've now
decided to close that enormous gap, and chose Python as the language to do
so.

My understanding is that OO is not that trivial, and that patterns have been
created as template solutions for common or difficult problems. As there
seems to be no specific book on patterns with Python, can anybody recommend
a book or a URL on patters which is language-independant, so that I do not
have to learn C++, Java or whatever first?

--
email: 'dXNlbHBhQG15cmVhbGJveC5jb20=\n'.decode('base64')


Max M

unread,
Feb 10, 2003, 3:07:48 PM2/10/03
to
Patrick Useldinger wrote:

> I am an "experienced" programmer, but as I've worked on mainframes for the
> last 13 years I never had the opportunity to experiment with OO. I've now
> decided to close that enormous gap, and chose Python as the language to do
> so.


Excellent choice ;-)

> My understanding is that OO is not that trivial, and that patterns have been
> created as template solutions for common or difficult problems. As there
> seems to be no specific book on patterns with Python, can anybody recommend
> a book or a URL on patters which is language-independant, so that I do not
> have to learn C++, Java or whatever first?


Actually I would advice that you try out some OO code before learning
patterns. But that's probably just me.

Anyhoo, you could do worse than reading "Python Programming Patterns",
which is almost exactly what you are asking for.

isbn: 0-13-040956-1

--

hilsen/regards Max M Rasmussen, Denmark

http://www.futureport.dk/
Fremtiden, videnskab, skeptiscisme og transhumanisme

Tim Gahnström /Bladerman

unread,
Feb 10, 2003, 3:33:30 PM2/10/03
to
"Patrick Useldinger" wrote :

> My understanding is that OO is not that trivial, and that patterns have
been
> created as template solutions for common or difficult problems. As there
> seems to be no specific book on patterns with Python, can anybody
recommend
> a book or a URL on patters which is language-independant, so that I do not
> have to learn C++, Java or whatever first?
>

There is a lot of information about design patterns avalible online, you
will get numerous hits on google.

One site wich seems to have alot of general and background information is
http://www.enteract.com/~bradapp/docs/patterns-intro.html

If you want to se actual implementations of design patterns in pyton you
might want to have a look at "Design Patterns in Python"
http://www.python.org/workshops/1997-10/proceedings/savikko.html

Tough my personal opinion is that designpatterns are not the best aproach to
learn OO. Designpatterns are a part of OO tough not an essential part.

I think that you will be better of by creating some small OO programs before
you jump on to designpatterns, wich I sometimes find fairly hard to grasp.

Good luck

Tim


Alex Martelli

unread,
Feb 10, 2003, 3:36:36 PM2/10/03
to
Patrick Useldinger wrote:

> there seems to be no specific book on patterns with Python, can anybody
> recommend a book or a URL on patters which is language-independant, so

Still pretty rough, but:

http://www.mindview.net/Books/TIPython


I think "language-independent" isn't that hot where Design Patterns
are involved -- see http://www.aleax.it/Python/5ep.html for some of
my reflections on the issue. I hope I'll be presenting a paper on
some real Python patterns at OSCON -- and then maybe one day, after
I've rested sufficiently from the Cookbook and the Nutshel, a book
on OOP and DP with Python (don't hold your breath...;-).


Alex

Mark McEahern

unread,
Feb 10, 2003, 2:52:44 PM2/10/03
to
> My understanding is that OO is not that trivial, and that patterns
> have been created as template solutions for common or difficult
> problems. As there seems to be no specific book on patterns with
> Python, can anybody recommend a book or a URL on patters which is
> language-independant, so that I do not have to learn C++, Java or
> whatever first?

Check this out:

http://www.mindview.net/Books/TIPython

// m
-


Laura Creighton

unread,
Feb 10, 2003, 2:49:41 PM2/10/03
to

I don't know of any, but http://hillside.net/patterns/ has an
enormous list of books with reviews. I'd be surprised if there is
one and it isn't there. The whole site is good for discussions
about Patterns.

good luck,
Laura Creighton


David M. Cook

unread,
Feb 10, 2003, 5:28:58 PM2/10/03
to
In article <3e480...@news.vo.lu>, Patrick Useldinger wrote:

> My understanding is that OO is not that trivial, and that patterns have been
> created as template solutions for common or difficult problems. As there
> seems to be no specific book on patterns with Python, can anybody recommend
> a book or a URL on patters which is language-independant, so that I do not
> have to learn C++, Java or whatever first?

Design Patterns Explained is a very good intro to patterns, but gives
examples in Java and C++. However, I think a casual understanding of Java is
adequate for the examples. It does assume some basic familiarity with OO
concepts but is not jargon-filled.

http://www.amazon.com/exec/obidos/ASIN/0201715945/

(Amazon links provided for reference only.)

A good introductory text on OO is by Timothy Budd:

http://www.amazon.com/exec/obidos/ASIN/0201760312/

I've never understood why people recommend Meyer's big OOSC book. I've
never found that book particularly useful or helpful.

It would be cool to have a book like _Design Patterns Java Workbook_ for
Python.

Do avoid the book _Python Programming Patterns_. An inaccurate title and a
big disappointment.

Dave Cook


Roman Suzi

unread,
Feb 10, 2003, 3:47:57 PM2/10/03
to
On Mon, 10 Feb 2003, Tim GahnstrЖm /Bladerman wrote:

-skip-


>Tough my personal opinion is that designpatterns are not the best aproach to
>learn OO. Designpatterns are a part of OO tough not an essential part.
>
>I think that you will be better of by creating some small OO programs before
>you jump on to designpatterns, wich I sometimes find fairly hard to grasp.

I agree. Design Patterns are good after some experimanting and practice with
2-3 real OOprojects. Then reading patterns book will make you feel that
patterns reflect your own thoughts.

Patterns are syntax, and I do not know people who learn syntax BEFORE ABC...


Sincerely yours, Roman Suzi
--
r...@onego.ru =\= My AI powered by Linux RedHat 7.3


Roman Suzi

unread,
Feb 10, 2003, 3:27:58 PM2/10/03
to
On Mon, 10 Feb 2003, Laura Creighton wrote:

>> Hello all,
>> I am an "experienced" programmer, but as I've worked on mainframes for the

...


>> My understanding is that OO is not that trivial, and that patterns have been

Interesting remark indeed. Our world is not trivial place and objects are here
to remove some complexity. OO is deliberatly non-trivial because otherwise
programmers will be jobless ;-)

Ryan

unread,
Feb 10, 2003, 6:41:27 PM2/10/03
to
I don't know about a book or a URL on patters which is
language-independant,
but there are two books that cover a nice bit of it for Python;

1) Python Programming Patterns by Thomas W. Christopher
http://www.amazon.com/exec/obidos/tg/detail/-/0130409561/qid=1044920194/sr=8-1/ref=sr_8_1/002-2386561-6330438?v=glance&s=books
2) Python Cookbook by Alex Martelli (Oriely)
http://posting.google.com/post?gs=%2Fgroups%3Fdq%3D%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3Dutf-8%26group%3Dcomp.lang.python%26selm%3D3e4800b2_2%2540news.vo.lu&msg=3e4800b2_2%40news.vo.lu&cmd=post&enc=ISO-8859-1

OO is more a mindset than anything, the fact that the language give
convinient constructs to use the concepts is just a big conviniance.

Worst case scenario you can check on the Java groups (or google) for
some of the most common explanations and patterns.

"Patrick Useldinger" <n...@way.lu> wrote in message news:<3e480...@news.vo.lu>...

John Ochiltree

unread,
Feb 11, 2003, 1:50:51 AM2/11/03
to
Patrick Useldinger wrote:

Python Programming Patterns by Thomas W Christopher

Alex Martelli

unread,
Feb 11, 2003, 5:21:46 AM2/11/03
to
Ryan wrote:

> I don't know about a book or a URL on patters which is
> language-independant,
> but there are two books that cover a nice bit of it for Python;
>
> 1) Python Programming Patterns by Thomas W. Christopher

> 2) Python Cookbook by Alex Martelli (Oriely)

[snipped overlong URLs]


Far be it from me to wish to discourage purchases of the Cookbook
(which is only *edited* by me and David Ascher, and published by
O'Reilly -- the *authors* are over a hundred Pythonistas), but I
do not agree that it covers "a nice bit" of design patterns -- it
barely scratches the surface here and there. My impression of
"Python Programming Patterns" is also that it's quite far from
Design Patterns, but I haven't looked at it in enough depth, so
it's just an impression.

> OO is more a mindset than anything, the fact that the language give
> convinient constructs to use the concepts is just a big conviniance.

To some extent, yes. However, in another sense, "the limits of
my language are the limits of my world" (Wittgenstein) applies --
*in practice* you won't use multiple dispatch in Python (nor in
C++, Java, C#, ....) BECAUSE the language does not support it
directly -- but you might well use it in Dylan for similar problems.

This does influence what patterns are actually available to you --
and more directly, which are relevant (many patterns deal with
working around limitations due to strict typing -- in Python all
such patterns are basically irrelevant).

I suggest www.aleax.it/Python/5ep.html for some reflections on
Patterns and NON-Patterns, in a Python context.


Alex

Michele Simionato

unread,
Feb 11, 2003, 10:28:42 AM2/11/03
to
"Patrick Useldinger" <n...@way.lu> wrote in message news:<3e480...@news.vo.lu>...

As many others have said, patterns are not so important in Python.
I would suggest you start from the _Python Cookbook_, which contains
quite a lot of good stuff (and a chapter on OOP, too).

This has been already suggested, but "repetita iuvant".
I think he "Cookbook" is worth its money, whereas I am not sure about
some of the more theoretical (as opposed to practical) books on patterns.

Good luck,

Michele

Mike Meyer

unread,
Feb 11, 2003, 12:43:40 PM2/11/03
to
"Patrick Useldinger" <n...@way.lu> writes:

> My understanding is that OO is not that trivial, and that patterns have been
> created as template solutions for common or difficult problems.

I want to respond to the first part of this - "that OO is not that trivial,".

That's true. But OO is still easier than procedural
programming. At least, it is for the programmers who are doing OO. If
it weren't, they wouldn't be doing OO.

Don't let the fact that they name OO idioms and refer to them
collectively as "patterns" scare you away. This naming is a good thing
- it means that people can refer to the idioms by name and be
understood. It also lets you find books that are collections of
idioms, which is also a good thing.

I'll add my voice to those advising you to do some programming before
you start looking into the patterns books. I think they'll make a lot
more sense if you have a grasp of OO before looking at them.

<mike
--
Mike Meyer <m...@mired.org> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

David M. Cook

unread,
Feb 11, 2003, 4:27:55 PM2/11/03
to
In article <j312a.3688$297...@news-binary.blueyonder.co.uk>, John Ochiltree
wrote:

> Python Programming Patterns by Thomas W Christopher

Yes, that has the word patterns in the title. The actual content relating
to design patterns is minimal. Here's an ACCU review:

http://www.accu.org/bookreviews/public/reviews/p/p003210.htm

Dave Cook

Patrick Useldinger

unread,
Feb 11, 2003, 5:09:43 PM2/11/03
to
Good start, but still quite "draft". I have Bruce's book on Java, so I know
it will *eventually* be very good. However, I find the "Python-like"
language in TIPython quite confusing.
I'll watch that space!
;-)

--
email: 'dXNlbHBhQG15cmVhbGJveC5jb20=\n'.decode('base64')

"Mark McEahern" <mark...@mceahern.com> wrote in message
news:mailman.1044906867...@python.org...

Patrick Useldinger

unread,
Feb 11, 2003, 5:16:56 PM2/11/03
to
"Mike Meyer" <m...@mired.org> wrote in message
news:x7hebal...@guru.mired.org...


> That's true. But OO is still easier than procedural
> programming. At least, it is for the programmers who are doing OO. If
> it weren't, they wouldn't be doing OO.

Maybe... but being a procedural programmer, OO is non-trivial for me,
whereas most procedural programs *are* easy to read for me if I know the
programming language.

> Don't let the fact that they name OO idioms and refer to them
> collectively as "patterns" scare you away. This naming is a good thing
> - it means that people can refer to the idioms by name and be
> understood. It also lets you find books that are collections of
> idioms, which is also a good thing.

Clearly, OO has a lot of specific terms, an so do patterns. But that doesn't
scare me, I am lazy myself so I would have done the same thing ;-)

> I'll add my voice to those advising you to do some programming before
> you start looking into the patterns books. I think they'll make a lot
> more sense if you have a grasp of OO before looking at them.

Promised!

Just

unread,
Feb 11, 2003, 5:36:03 PM2/11/03
to
In article <3e497...@news.vo.lu>, "Patrick Useldinger" <n...@way.lu>
wrote:

> Maybe... but being a procedural programmer, OO is non-trivial for me,
> whereas most procedural programs *are* easy to read for me if I know the
> programming language.

Python should be perfect for you. I came to Python from Basic,
assembler, Pascal, PostScript and a bit of C; objects were mostly new to
me when I started with Python. Friends had shown C++ and SmallTalk but
that had totally the wrong learning curve for me (being a lazy amateur
programmer). Python makes it real easy as it isn't _purely_ OO, in the
sense that you don't have to write a class to get "hello world" going.
First you start to _use_ objects (eg. files, lists), learn what methods
are. Then you learn what the mechanics of classes are, and you will
slowly learn how to factor things into objects, and at that point
patterns become interesting. Python is great for learning OO gradually.

Just

Alex Martelli

unread,
Feb 11, 2003, 6:24:15 PM2/11/03
to
Michele Simionato wrote:
...

> As many others have said, patterns are not so important in Python.

Heh -- let me get on record as firmly disagreeing with this.

Not the SAME patterns you might use in some other language,
of course, but, Python has its own -- and they're just as
much of a help to your design (and design maintenance) as
in any other language.

> I would suggest you start from the _Python Cookbook_, which contains
> quite a lot of good stuff (and a chapter on OOP, too).

By the way of qualifications, which I think may make my
above-mentioned opinion of interest, I co-edited that book
and in particular wrote the introduction to that chapter.

I also wrote and presented at IPC10 a paper on Python
*NON*-patterns, see www.aleax.it/Python/5ep.html -- so I'm
no *rabid fan* of patterns whether they're appropriate or
not -- but I think some patterns often ARE quite perfectly
appropriate, in Python just as in other languages (though,
to repeat, not the same patterns -- appropriate DP's to use
ARE language dependent, as the authors of the classic book
"Design Patterns" strongly emphasize too).


> This has been already suggested, but "repetita iuvant".
> I think he "Cookbook" is worth its money, whereas I am not sure about
> some of the more theoretical (as opposed to practical) books on patterns.

Highly theoretical works can be more appropriate _after_
one has gained practical grounding in the praxis of some
field, yes. And the Cookbook is good to guide you to get
some of that "practical grounding", I agree.


Alex

Carl Caulkett

unread,
Feb 11, 2003, 6:45:25 PM2/11/03
to
On Mon, 10 Feb 2003 23:27:58 +0300 (MSK), Roman Suzi <r...@onego.ru>
wrote:

<snip>

>OO is deliberatly non-trivial because otherwise programmers will be jobless ;-)

Shhhhhh! Don't give the game away <g>

--
Carl

Michele Simionato

unread,
Feb 12, 2003, 9:14:19 AM2/12/03
to
Alex Martelli <al...@aleax.it> wrote in message news:<zCf2a.225038$AA2.8...@news2.tin.it>...

> Michele Simionato wrote:
> ...
> > As many others have said, patterns are not so important in Python.
>
> Heh -- let me get on record as firmly disagreeing with this.
>
> Not the SAME patterns you might use in some other language,
> of course, but, Python has its own -- and they're just as
> much of a help to your design (and design maintenance) as
> in any other language.


Alex, I agree with you. I wanted to say "patterns (as are intended in
C++ books) are not so important in Python, (since in Python they can
often implemented as recipes)". I was sloppy (since PEP308 is taking
a lot of time ;) and I dropped the parenthesis.

> > I would suggest you start from the _Python Cookbook_, which contains
> > quite a lot of good stuff (and a chapter on OOP, too).
>
> By the way of qualifications, which I think may make my
> above-mentioned opinion of interest, I co-edited that book
> and in particular wrote the introduction to that chapter.
>
> I also wrote and presented at IPC10 a paper on Python
> *NON*-patterns, see www.aleax.it/Python/5ep.html -- so I'm
> no *rabid fan* of patterns whether they're appropriate or
> not -- but I think some patterns often ARE quite perfectly
> appropriate, in Python just as in other languages (though,
> to repeat, not the same patterns -- appropriate DP's to use
> ARE language dependent, as the authors of the classic book
> "Design Patterns" strongly emphasize too).
>
>
> > This has been already suggested, but "repetita iuvant".
> > I think he "Cookbook" is worth its money, whereas I am not sure about
> > some of the more theoretical (as opposed to practical) books on patterns.
>
> Highly theoretical works can be more appropriate _after_
> one has gained practical grounding in the praxis of some
> field, yes. And the Cookbook is good to guide you to get
> some of that "practical grounding", I agree.
>
>
> Alex

On one hand, I think it is useful to have a common name for something
which is
often used, such as a Singleton, Visitor, etc. On the other hand, as a
matter of personal taste, I don't like books spending hundreds of
pages
discussing doubtful classifications. I haven't read the original one,
though.
Maybe it is better than the books I have seen.

Anyway, to the OP I wanted to suggest that somebody entering in the
OOP field should not start with a theoretical book, but with a
practical one. I think
we agree on that.

Michele

Patrick Useldinger

unread,
Feb 12, 2003, 12:23:53 PM2/12/03
to
"Just" <ju...@xs4all.nl> wrote in message
news:just-D9CB4B.2...@news1.news.xs4all.nl...

> Python makes it real easy as it isn't _purely_ OO, in the
> sense that you don't have to write a class to get "hello world" going.
> First you start to _use_ objects (eg. files, lists), learn what methods
> are. Then you learn what the mechanics of classes are, and you will
> slowly learn how to factor things into objects, and at that point
> patterns become interesting. Python is great for learning OO gradually.

Well, I think it's a blessing and a pitfall at the same time. I wrote some
small programs in Python, and of course, I didn't create one single class of
my own. Using classes is not so difficult, you write function(object) or
object(function), not a big deal. Like Visual Basic...

Recently, I had a case where I needed static variables, and didn't want to
resort to global variables. It was only *then* that it made 'click' and I
started to see what an object might be good for. And while I was at it, I
found other interesting uses.

So there is the pitfall: as you are not forced to be OO, at least not all
the time, you might find a million of ways to get around classes. So in that
way, Python is a bit risky, especially if you are lazy like I am.

Aahz

unread,
Feb 12, 2003, 1:00:21 PM2/12/03
to
In article <just-D9CB4B.2...@news1.news.xs4all.nl>,

Just <ju...@xs4all.nl> wrote:
>
>Python should be perfect for you. I came to Python from Basic,
>assembler, Pascal, PostScript and a bit of C; objects were mostly new to
>me when I started with Python. Friends had shown C++ and SmallTalk but
>that had totally the wrong learning curve for me (being a lazy amateur
>programmer). Python makes it real easy as it isn't _purely_ OO, in the
>sense that you don't have to write a class to get "hello world" going.
>First you start to _use_ objects (eg. files, lists), learn what methods
>are. Then you learn what the mechanics of classes are, and you will
>slowly learn how to factor things into objects, and at that point
>patterns become interesting. Python is great for learning OO gradually.

Of course, you had a built-in advantage learning Python, being....


....Dutch.
--
Aahz (aa...@pythoncraft.com) <*> http://www.pythoncraft.com/

Register for PyCon now! http://www.python.org/pycon/reg.html

Aahz

unread,
Feb 12, 2003, 1:04:27 PM2/12/03
to
In article <qm2j4v4pfhs6r5a4i...@4ax.com>,

Carl Caulkett <car...@dircon.co.uk> wrote:
>On Mon, 10 Feb 2003 23:27:58 +0300 (MSK), Roman Suzi <r...@onego.ru>
>wrote:
>>
>>OO is deliberatly non-trivial because otherwise programmers will be
>>jobless ;-)
>
>Shhhhhh! Don't give the game away <g>

http://www.netfunny.com/rhf/jokes/98/May/stroustrup.html

Alex Martelli

unread,
Feb 12, 2003, 1:46:44 PM2/12/03
to
Michele Simionato wrote:
...

> matter of personal taste, I don't like books spending hundreds of
> pages
> discussing doubtful classifications. I haven't read the original one,
> though.
> Maybe it is better than the books I have seen.

The Gang of Four's "Design Patterns" is a great book, and a very
practical one. It's _strongly_ oriented to C++ however (to write
a GREAT, practical book on design patterns I think you do have to
strongly orient to one "target" programming language).


> Anyway, to the OP I wanted to suggest that somebody entering in the
> OOP field should not start with a theoretical book, but with a
> practical one. I think we agree on that.

Yes, we do. Practice underlies theory, and getting some practice
before delving into the theory is an excellent idea.


Alex


Mike Meyer

unread,
Feb 12, 2003, 3:34:42 PM2/12/03
to
Carl Caulkett <car...@dircon.co.uk> writes:

Ok, what's the trivial programming style that we're hiding from the
people paying the salaries? That's the one I want to learn.

Erik Max Francis

unread,
Feb 12, 2003, 7:18:21 PM2/12/03
to
Aahz wrote:

> http://www.netfunny.com/rhf/jokes/98/May/stroustrup.html

So _that's_ where that rumor came from (which I first heard and
immediately didn't buy, and have seen disspelled several times): It
actually started as a joke.

--
Erik Max Francis / m...@alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/ \ If you can't fight and you can't flee, flow.
\__/ Robert Elliot
Physics reference / http://www.alcyone.com/max/reference/physics/
A physics reference.

Michele Simionato

unread,
Feb 13, 2003, 2:50:22 PM2/13/03
to
Just <ju...@xs4all.nl> wrote in message news:<just-D9CB4B.2...@news1.news.xs4all.nl>...
> Python should be perfect for you. I came to Python from Basic,
> assembler, Pascal, PostScript and a bit of C; objects were mostly new to
> me when I started with Python. Friends had shown C++ and SmallTalk but
> that had totally the wrong learning curve for me (being a lazy amateur
> programmer). Python makes it real easy as it isn't _purely_ OO, in the
> sense that you don't have to write a class to get "hello world" going.
> First you start to _use_ objects (eg. files, lists), learn what methods
> are. Then you learn what the mechanics of classes are, and you will
> slowly learn how to factor things into objects, and at that point
> patterns become interesting. Python is great for learning OO gradually.
>
> Just

Actually, I wanted to learn C++. But since in C++ everthing is mixed up
(syntax, memory management, object model, etc) I thought: better if I learn
OOP from a language without additional complications, then, once I understand
the relevant concepts I can translate them to C++.
The problem is that, now that I know Python, I have lost any motivation
to learn C++ anymore ...


Michele

Carlos Ribeiro

unread,
Feb 14, 2003, 8:42:26 AM2/14/03
to
On Wednesday 12 February 2003 16:46, Alex Martelli wrote:
> Michele Simionato wrote:
> ...
>
> > matter of personal taste, I don't like books spending hundreds of
> > pages
> > discussing doubtful classifications. I haven't read the original one,
> > though.
> > Maybe it is better than the books I have seen.
>
> The Gang of Four's "Design Patterns" is a great book, and a very
> practical one. It's _strongly_ oriented to C++ however (to write
> a GREAT, practical book on design patterns I think you do have to
> strongly orient to one "target" programming language).

The GOF book is really excellent and deserves its ratings. As for the
'doubtful classifications', well... if there is one fault with Design
Patterns, it's the way the subject lends itself to discussion. Wikis are
partly to blame also; instead of a few definitive and respectable sources of
information, one can find literally thousands of confusing, duplicate and/or
imprecise patterns definitions.

In this sense, Design Patterns resources should be regarded as dictionaries;
although everyone can write its own, a few ones are respected because of
their authority on the subject. It should be the same with DPs; in fact, it's
not a coincidence that Christopher Alexander defined Design Patterns in terms
of their unique 'language' (in his own words).

> > Anyway, to the OP I wanted to suggest that somebody entering in the
> > OOP field should not start with a theoretical book, but with a
> > practical one. I think we agree on that.
>
> Yes, we do. Practice underlies theory, and getting some practice
> before delving into the theory is an excellent idea.

This is even more valid for Design Patterns, because patterns are based on
practical experiences. BTW, reading Cristopher Alexander's original works on
patterns lets you understand this point much more clearly.

--
Carlos Ribeiro
crib...@mail.inet.com.br

dmi...@djam.com

unread,
Feb 18, 2003, 6:46:05 AM2/18/03
to
"Patrick Useldinger" <n...@way.lu> wrote in message news:<3e480...@news.vo.lu>...
> Hello all,
>
> I am an "experienced" programmer, but as I've worked on mainframes for the
> last 13 years I never had the opportunity to experiment with OO. I've now
> decided to close that enormous gap, and chose Python as the language to do
> so.
>
> My understanding is that OO is not that trivial, and that patterns have been
> created as template solutions for common or difficult problems. As there
> seems to be no specific book on patterns with Python, can anybody recommend
> a book or a URL on patters which is language-independant, so that I do not
> have to learn C++, Java or whatever first?

Bruce Eckel has a book in progress called thinking in patterns,
oriented towards Python... bruceeckel.com

Klaus Momberger

unread,
Feb 18, 2003, 12:57:22 PM2/18/03
to
"Patrick Useldinger" <n...@way.lu> wrote in message news:<3e480...@news.vo.lu>...
> Hello all,
>
> I am an "experienced" programmer, but as I've worked on mainframes for the
> last 13 years I never had the opportunity to experiment with OO. I've now
> decided to close that enormous gap, and chose Python as the language to do
> so.
>
I am probably in the wrong newsgroup, but imho you will be better off with
Smalltalk and "The Design Patterns Smalltalk Companion".

-klaus.

Tom Loredo

unread,
Feb 18, 2003, 4:50:26 PM2/18/03
to

Hi-

It's not quite what you asked for, yet still I think it might be
worth taking a peek at Apple's *Objective C Programming Language* book:

http://developer.apple.com/techpubs/macosx/Cocoa/ObjectiveC/ObjC.pdf

I don't know objective C, and my brief perusal of this book doesn't
exactly encourage me to learn it. But the introductory chapter on
the "philosophy" behind the OO approach is one of the best things
I've read on this topic. Some of the terminology doesn't quite carry
over into Python, but it's a good read nevertheless.

Peace,
Tom

Just

unread,
Feb 19, 2003, 1:07:16 PM2/19/03
to
In article <3E52AAA2...@astro.cornell.edu>,
Tom Loredo <lor...@astro.cornell.edu> wrote:

I haven't read this book, but the Cocoa frameworks are a great source of
inspiration for OO design. Objective-C is pretty lame compared to
Python, but it's a very nice hybrid from a C perspective; it has dynamic
method dispatching and a nice object model. Objective-C's and Cocoa's
philosophy are fairly "pythonic", eg. containment is often preferred
over inheritance. ObjC is very easy to pick up if you know C and Python,
which I found is not true of C++ (although I must admit I wasn't really
motivated to try very hard, erm, at all actually). But then again, I
only learned a bit of ObjC to help out with the PyObjC project, which
allows me to use Cocoa from Python.

Just

0 new messages