does lack of type declarations make Python unsafe?

Peter Hansen peter at engcorp.com
Mon Jun 16 22:30:36 EDT 2003


Moshe Zadka wrote:
> 
> On Mon, 16 Jun 2003, Peter Hansen <peter at engcorp.com> wrote:
> 
> > Don't mistake me for the XP community.  I'm just me.
> 
> Your attitude is, however, typical :)

I could get into how yours, too, is typical of ... well, why don't
we just stay away from ad hominem attacks, shall we?

> Source code is *always* a liability. 

Okay, now it's just a semantic argument, until we define what each
of us means by "liability".  I'd explore that, but I'm not sure whether
you'll just get into my "attitude" again, smiley or not.

> > For my company, it's very clear that it's true, however, so I guess
> > once again (surprise!) I speak only for myself.  :-)
> 
> I doubt it is true, even for your company. Source code is *always*
> a liability, unit-tests or no unit-tests. It is an *acceptable*
> liability, sometimes, if you get enough functionality out of it.

Okay, using your terminology here: source code with unit tests is
an acceptable liability, source code without good tests is an 
unacceptable liability.  I'm not sure whether you work on your own,
or for a large company, but in *my* company this is a useful 
perspective for us to have most of the time.

> > I agree.  Good thing we don't actually *always* write tests, nor
> > always write them first.  ;-)
> 
> That sort of makes your methodology from "TDD" to "Sometimes TDD,
> if it looks like the right thing". So preaching TDD while not
> practicing it is...well...

Nothing is absolute.  Why do you think I have to be absolute in
my position?  That would be silly, and impractical.  Do you really
know *anyone* sensible who will insist that their viewpoint is 
correct, under all imaginable conditions?

> > Don't mistake strong claims for religion either...  I make them
> > to spur the truly test-less on to consider and investigate and
> > practice writing tests, because _they_ are the ones who are
> > writing crappy code, not you, who might understand when to test
> > and when not to test.

> It's better to teach people the truth, no? Instead of teaching them
> about some rosy place which doesn't exist. 

The truth?  You want the truth?  You can't handle the truth!  :-) 
No, really, movie references aside, the truth is that *for me*, TDD 
has proven to be an *extremely* valuable advancement over all 
previous methods attempted, over a 23 or so year history of writing
code.  I don't particular care whether *you*, personally, like it
or not, but I'd appreciate it if you wouldn't attempt to claim that
it is not beneficial for me, if that's what you're trying to do.  

More likely you are simply trying to say that it is not *always* an
appropriate or useful method, and I don't believe I've ever said anything
that should lead any intelligent person to conclude otherwise.

> I feel you are doing unit-testing a disservice: if someone buys into it, 
> and finds that it isn't a win always, he'll just assume that it is worth 
> nothing.

Pah!  We're not talking about a bunch of morons here, we're talking about
intelligent people who might not have encountered a particular approach
which could allow them to improve the quality of their output.  Why
would you think people aren't intelligent enough to understand that
nothing is an absolute, that no process or language or generalization
of any kind will ever be adequate for all possible situations?  If I've
said something that claims XP or TDD will work for everyone, always, 
then I hereby take it back, but I'm sure I haven't said such a thing
unless it was in one of my 3:30 in the morning after a lousy few hours
of sleep kind of postings...

> In fact, I assumed tests are worth nothing after finding some glaring
> holes in XP's logic, and it took me a long time to be convinced that
> they are ever helpful. Assuming there are others like me, it is better
> to be honest about the limitations of technology first :)

-Peter




More information about the Python-list mailing list