[Zope3-dev] Notations for paths
Phillip J. Eby
pje@telecommunity.com
Thu, 19 Dec 2002 18:26:49 -0500
At 05:12 PM 12/19/02 -0500, Guido van Rossum wrote:
> > > 1) shuffle around tuples for something that *isn't* a tuple
> >
> > But it is! It's a sequence of steps for traversal.
>
>Then it should be a list. Tuples should be used for fixed-length
>heterogeneous sequences. Lists for variable-length homogeneous
>sequences.
Great! Now in addition to parsing errors, we can have errors caused by
accidentally modifying shared mutable objects. Zope 3 applications will
then be even *more* fun to debug than Zope 2 applications... if you're a
masochist, anyway. ;)
IMO, immutability is an application framework's first line of defense
against "how the heck is *that* happening?" errors by the framework's
users. Raising errors early (as would happen when an API tries to coerce
an invalid location object) is the second.
I'd say I don't really care about this because I'm not the one who'll have
to support Zope 3, but that's not really the case. I *will* be the person
supporting Zope 3 for my development staff, and occasionally people in
other parts of the company I work for as well. That's why I'm -0 on using
simple types where a framework-specific interface is desirable, and -1 or
more on using mutable types anywhere that "value" semantics are
desired. These are both near the top of my hypothetical list of the "top
10 ways to mess up users of a framework and make their programs hard to debug".