Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #15318

Re: Design Pattern and Python: Any book recommendation? Your view?

References <6097694.446.1320366784098.JavaMail.geo-discussion-forums@prap37>
Date 2011-11-03 19:15 -0700
Subject Re: Design Pattern and Python: Any book recommendation? Your view?
From Chris Rebert <clp2@rebertia.com>
Newsgroups comp.lang.python
Message-ID <mailman.2422.1320372912.27778.python-list@python.org> (permalink)

Show all headers | View raw


On Thu, Nov 3, 2011 at 5:33 PM, Anthony Kong <anthony.hw.kong@gmail.com> wrote:
> Sorry to resurrect this topic. By google search the last discussion was in 2003.
>
> I would like to find out what is the current prevailing view or consensus (if any) on the use of Design Pattern in python?

I can only speak for myself, but the whole idea of design patterns is
broken. The existence of nontrivial design patterns indicates language
deficiencies. For more extensive corroborating discussions, see:
http://www.codinghorror.com/blog/2005/06/are-design-patterns-how-languages-evolve.html
http://c2.com/cgi/wiki?AreDesignPatternsMissingLanguageFeatures

Python thankfully has relatively few/minor deficiencies (so long as
one judges it within its dynamic language niche), so design patterns
per se aren't too relevant to it.

The canonical Python-specific design pattern is Borg
(http://code.activestate.com/recipes/66531-singleton-we-dont-need-no-stinkin-singleton-the-bo/
) [a variation on Singleton], and nowadays it (like its parent,
Singleton) is considered to be of dubious utility/advisability.

> I am doing some 'fact-finding' in this area on request of my colleagues. Some of them want to buy a book or two in this subject area. Hopefully the newsgroup can give me some book recommendation and insight in this topic.

The closest alternative would be some publication that gave examples
of using some of Python's fancier, higher-level features, such as
metaclasses and context managers. I haven't been in the market for
such a book, so I have no good recommendations to give. Closest I
could suggest would be the Language Reference
(http://docs.python.org/reference/ ) and relevant PEPs
(http://www.python.org/dev/peps/ ; they tend to include examples by
way of motivating use-cases).

> I myself pretty much subscribe to the view that the nature of python language actually do away much of the need of the use of DP, but it is just a personal view. It comes form my experience of migrating from webware4py (webframework based on J2EE/servlet idea) to cherrypy

I am glad you agree.

Cheers,
Chris
--
http://rebertia.com

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Design Pattern and Python: Any book recommendation? Your view? Anthony Kong <anthony.hw.kong@gmail.com> - 2011-11-03 17:33 -0700
  Re: Design Pattern and Python: Any book recommendation? Your view? Roy Smith <roy@panix.com> - 2011-11-03 21:46 -0400
  Re: Design Pattern and Python: Any book recommendation? Your view? Chris Rebert <clp2@rebertia.com> - 2011-11-03 19:15 -0700
  Re: Design Pattern and Python: Any book recommendation? Your view? Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2011-11-04 10:49 +0100
  Re: Design Pattern and Python: Any book recommendation? Your view? John Roth <johnroth1@gmail.com> - 2011-11-04 05:28 -0700
    Re: Design Pattern and Python: Any book recommendation? Your view? Joe Riopel <goon12@gmail.com> - 2011-11-04 08:41 -0400
  Re: Design Pattern and Python: Any book recommendation? Your view? Andrea Crotti <andrea.crotti.0@gmail.com> - 2011-11-04 12:46 +0000
  Re: Design Pattern and Python: Any book recommendation? Your view? Terry Reedy <tjreedy@udel.edu> - 2011-11-04 15:45 -0400
  Re: Design Pattern and Python: Any book recommendation? Your view? Ned Deily <nad@acm.org> - 2011-11-04 13:11 -0700

csiph-web