Flying With Python (Strong versus Weak Typing)

Peter Hansen peter at engcorp.com
Wed Mar 12 05:51:54 EST 2003


Mike Silva wrote:
> 
> Peter Hansen <peter at engcorp.com> wrote in message news:<3E6E5EEF.F128744B at engcorp.com>...
> > Anyway, the article doens't necessarily support the conclusion you
> > appear to be claiming (that static typing produced a factor of 100
> > improvement in error rates).
> 
> My only claim was that "Language (including, but not limited to,
> static typing) definitely makes a difference."

Well, I doubt a Python programmer (Alex included) would claim that
language makes *no* difference, so if we're down to discussing 
a simple "does" "does not" type of question, we're probably all
in agreement.  (I don't speak for Alex though, although I can do
an excellent impersonation of his cat. :-)

> > For one thing, it is comparing the SPARK results to common results
> > with Ada, which are then compared with common C results.  C is
> > hardly on a par with Python as far as weak and strong typing goes
> > (though it is somewhat statically typed... when you avoid casting).
> 
> But *all* the code was certified to DO-178B Level A (the highest [most
> safety-critical] level).  It's probably just about as close as you can
> get to an oranges vs. oranges comparison.  Neither the SPARK code, nor
> the Ada code, nor the C code, was in any way "common."

Sorry, I meant "common results amongst DO-178B certified software".

> > For another thing, the results came from not just a language, but the
> > approach used, including "semi-formal specifications", "thin-slice
> > prototyping of high risk areas" (i.e. "testing"), a "template-driven
> > approach" for boilerplate types of code, plus the static analysis
> > to which you appear to give all the credit.
> 
> Arrgh!!! :-]  I don't give "all the credit" to static analysis (I
> think you mean static typing here?)  

No, the article refers to static analysis, not just static typing. 
I infer from that that SPARK enables and includes tools that perform
a superset of the checking typically performed by statically typed
languages (again, making the argument even harder to continue, since
then we're talking about possible features none of us even know about, 
compared to Python).

> > Perhaps this quote summarizes it best: "Lockheed succeeded because
> > they had a strong process with an emphasis on requirements capture
> > and accurate specifications."
> 
> Then by implication all of the other code, which had also been
> certified to Level A, was developed *without* a strong process, etc?

I thought that was what the article was implying, or stating outright.
Which would go back to reducing the claimed value of static typing
alone.  Maybe I misinterpreted the bits I read.

> > (Disclaimer: I'm just rushing off to a meeting and having read the
> > whole thing, so I risk looking foolish for overlooking something
> > key to that article.)
> 
> (Disclaimer: I often look foolish even when I'm not rushing, so I can
> empathize!)

:-)

In the end this kind of argument often seems to reduce to a matter
of degree.  If no one claims an absolute position ("has no effect",
"makes no difference", "is absolutely critical for") then we end
up being unable to discuss more than our respective faith that
certain things are more or less valuable than others.  Without 
real data (and the background knowledge to understand its relevance,
as I certainly don't regarding the article in question), the 
debate gets pointless fast.

-Peter




More information about the Python-list mailing list