[Python-Dev] Re: PEP 282 comments

Jeremy Hylton jeremy@zope.com
Thu, 21 Mar 2002 19:40:49 -0500


>>>>> "TM" == Trent Mick <trentm@ActiveState.com> writes:

  TM> The argument for the former is:
  TM> (1) KISS and YAGNI

I've said my piece for the most part, but this YAGNI stuff bugs me.
YAGNI means: 

    Always implement things when you actually need them, never when
    you just foresee that you need them. 
    [From http://www.xprogramming.com/Practices/PracNotNeed.html] 

I actually need this feature.  If the standard logger doesn't have it,
we'll have to extend Zope with a Zope-specific logger that adds the
feature.  I'm not asking for a feature because I think it might be
useful.

Rather, I'd think that Kevin and I are offering some real-world
experience.  We've written or maintain large, production-quality
applications that use logging.  In Zope, it has been useful to log
tracebacks for exceptions at levels other than error.  And it has been
necessary to pass an exception explicitly because sys.exc_info() would
get stomped by a subsequent exception.

Now, KISS is different.  It may be that the kinds of things that Kevin
and I are trying to do are so unusual that no one else will ever do
it.  By this argument, supporting a few cases from oddball customers
makes your code harder to understand and maintain; perhaps other users
will find the interface confusing because of the extra features.

Jeremy