What is the command to determine an object's type?

Philip Swartzleonard starx at pacbell.net
Wed Feb 6 16:14:30 EST 2002


Laura Creighton || Wed 06 Feb 2002 10:12:20a:

> I think that everybody should read Design Patterns because it is the
> single best way I know of to improve your code.  (And your life.
> Life is more fun when your code is more maintainable.)  However,
> for a Python programmer, there is one problem with the original
> text:  Design Patterns.

In my opinion (;), 'Code Complete' is up there around it too. It has 
nothing to do with objects, but it has a lot of material on designing at 
the routine level, how to make good loops and stuff like that, and you 
still need to be able to do that kind of thing in your objects methods. It 
also discusses general programming/intelectual honesty/metahphors and 
similar, and has some basic information on highel level design of 
functional programs. But Design Patters is definatly a great book if you 
want to do anything with objects :). (For c++, i'd reccomend those two, 
'accelerated c++', and stroushtrup-whatsit's bible :)
 
> It is written for C++.
> 
> This means that while a lot of the text is about the really good stuff,
> the patterns, at least half of it could be entitled 'my struggles with
> the C++ type system'.  And since you came to this discussion because
> you wanted to test the type of something, which is something that
> Mark McEahern and I both think that you probably ought not to be doing
> at all, you may get the wrong lesson from reading that book now.  
> 
> There is another book, The Design Patterns Smalltalk Companion,
> (Alpert Brown Woolf), which is meant to be read at the same time
> as the Design Patterns.  Smalltalk does not have declared types
> either.  As a result, patterns in Python end up looking a lot 
> more like Patterns in Smalltalk.  I find the Design Patterns
> Smalltalk Companion to be a lot easier to understand than its
> parent, as well.  But when you get a look at the Smalltalk syntax,
> you will see one of the reasons why Smalltalk has not taken over
> the world by now, mores the pity.

Hm, i may have to take a look at this one. Thanks for pointing out that it 
exists :)

-- 
Philip Sw "Starweaver" [rasx] :: www.rubydragon.com



More information about the Python-list mailing list