anything like C++ references?

Roy Smith roy at panix.com
Sun Jul 13 21:36:14 EDT 2003


Jack Diederich <jack at performancedrivers.com> wrote:
> I was a long time C++ guy and my a-ha moment was when I realized that the
> GoF's "Design Patterns" were not all universal -- some are C++ specific.
> Trying to force Python semantics into a C++ world view will leave you feeling
> empty every time.

Thank you for writing this, it makes me feel better!

I was having exactly this discussion just a couple of days ago with our 
local hard-core C++ guy (who also poo-poo's Python, even though he's 
never actually tried it).  I made exactly the point Jack made -- that 
the Design Pattern book is rather C++-centric, and some of it just 
doesn't tranlate into Python very well.

For example, in the chapter  on the Singleton pattern, a lot of time is 
devoted to (what I consider) esoterica in the C++ access control system 
(making copy constructors private, and all that stuff) to make sure 
nobody can cheat and find a way to make a copy of the singleton.  None 
of that makes any sense in Python because (for better or worse), the 
concept of private members just doesn't exist.




More information about the Python-list mailing list