Of what use is 'lambda'???

Michal Wallace sabren at manifestation.com
Sun Sep 24 23:03:28 EDT 2000


On Mon, 25 Sep 2000, Jonadab the Unsightly One wrote:

> Encapsulation arguments never win any points with me.  If
> the user shouldn't call it, just give it the docstring 
> "internal function", but frankly I've not infrequently found 
> myself legitimately calling code that the author considered 
[..]
> give the single cryptic "Careful; this has side-effects"
> and let 'em figure it out.  Encapsulation is essentially
> saying "This is for my convenience, but if you need to
> do the same thing you'll have to write your own code,
> because I won't let you use mine."  If that's your deal,

You know, there's another way to look at encapsulation.. We hide
certain variables and functions so that the interface we DO present
can be simpler.. Also, we can change the implementation later without
screwing up the caller's code. Finally, the less the calling code
knows about the interal workings of an object, the easier it is to
replace that object with something else later.

Done right, encapsulation makes for simpler, more flexible software.
It's not there to play keep-away with functionality.. 

Cheers,

- Michal
------------------------------------------------------------------------
www.manifestation.com  www.sabren.com  www.linkwatcher.com  www.zike.net
------------------------------------------------------------------------





More information about the Python-list mailing list