comp.lang.ada
 help / color / mirror / Atom feed
* RE: Is strong typing worth the cost?
@ 2002-04-29 23:26 Beard, Frank [Contractor]
  0 siblings, 0 replies; 166+ messages in thread
From: Beard, Frank [Contractor] @ 2002-04-29 23:26 UTC (permalink / raw)


-----Original Message-----
From: dmjones [mailto:derek@NOSPAMknosof.co.uk]


>> Because then they will have to program in all the necessary
>> checking to prevent erroneous results.  The group that uses

> Not necessarily.  If I know a particular quantity will vary
> between 1..5 I will define such a type.  I know that I then get
> this 1..5 assumption checked for me, which is useful.  But would
> I go to the effort of putting all those 1..5 checks in by hand?
> I doubt it.

But that's my point.  You would by using a strong typing feature,
in this case a subtype range.  If you were not using strong typing,
then you would have to write in checks to ensure the value was
within that range.  Otherwise, you get unexpected, and erred,
results.
 
>> How are you going to determine that the unprotected group
>> programmed all the necessary checking?  Are you going to
>> have some type of code analysis software to check it out?
>> This will have a huge impact on downstream maintenance.

> Can back this statement up with some evidence?

Not with a study that you're looking for, just practical
experience (though I do remember reading articles off an on).

I worked on a Fortran graphics project a number of years back.
Fortran has no protection from going outside any boundaries
you define (at least not back then).  The data that was being
plotted looked fine most of the time, when suddenly the graph
would flat-line either high or low.  It took days, if not weeks,
to figure out where a rounding error was occurring.  Someone had
forgotten to explicitly declare a variable as a float, and it
had defaulted to an integer.  So, there was rounding error that
sometimes lead to an out-of-bounds high or out-of-bounds low
value.  That would never have happened with Ada.  For one, you
would have to explicitly convert between the types, instead of
continuing along in blissful ignorance.  Secondly, you would
have gotten an exception, with a traceback, telling you where
the offending code was located.  We didn't even know that with
the Fortran (hours and hours of painful attempts to recreate
the situation).

I had a similar experience with interfacing to C code on Windows.
A C DLL we interfaced with went wandering out through our code
and eventually crashed the application.  Fortunately, with CodeView
debugging on, the traceback pointed back into the C code, where
the C programmer figured out he was interrogating the data structure
the was passed to him.  The problem was it was an empty structure
that his code was supposed to populate.  For some reason, his code
was trying to examine it and print the contents of one of the string
values.  All the strings were blank filled, so it went who knows
where until it cause some type of segmentation fault and crash the
application.

Anyway, I'm sorry I don't have the time to try and dredge up the
articles from the past, but I've been in both environments (strongly
typed and loosely typed) and I never want to go back to loosely
typed languages.

Frank



^ permalink raw reply	[flat|nested] 166+ messages in thread
* Re: Is strong typing worth the cost?
@ 2002-04-30 21:34 Gralia, Mars  J.
  0 siblings, 0 replies; 166+ messages in thread
From: Gralia, Mars  J. @ 2002-04-30 21:34 UTC (permalink / raw)


dmjones <derek@NOSPAMknosof.co.uk> asked:
> I have been trying to locate evidence that the cost of the use
> of strong typing is repaid by a greater benefit.

I believe I saw an article exactly like this in the journal Communications
of the Association for Computing Machinery (ACM) perhaps seven (7) years
ago.

They ran the study by taking something like a dozen college Computer Science
folks, inventing two pseudo-languages (with and without strong typing) and
let them go at it.  Strong typing was better in
time-to-produce-a-correct-program.  It was slower in
time-to-get-a-program-which-cycled.

Sorry, but our library doesn't yet have the ACM on-line, so I can't search
for it. I did search the IEEE archives and found nothing; I looked in
"journals, conference proceedings and standards".  I also looked in INSPEC,
but was overwhelmed with the number of low-value results.

M. Gralia



^ permalink raw reply	[flat|nested] 166+ messages in thread
* RE: Is strong typing worth the cost?
@ 2002-04-30 20:32 Beard, Frank [Contractor]
  0 siblings, 0 replies; 166+ messages in thread
From: Beard, Frank [Contractor] @ 2002-04-30 20:32 UTC (permalink / raw)



> OK this is very trivial, but think about this in a big complex program
> where the variables are not so obvious. Say a Mars probe that crashes
> due to a simple bug or whatever.

Exactly.  Do you see any cost/benefit of not crashing your
Mars probe into the planet?  Or lets say you're dealing with
a vehicle that transports people.  Do you see any cost benefit
of not crashing it into the ground?  Let's see, big lawsuit 
equals big cost.  As far as the benefit, ask the people traveling
on the vehicle.



^ permalink raw reply	[flat|nested] 166+ messages in thread
* RE: Is strong typing worth the cost?
@ 2002-04-30 18:08 Beard, Frank [Contractor]
  2002-05-01 11:07 ` David Gillon
  0 siblings, 1 reply; 166+ messages in thread
From: Beard, Frank [Contractor] @ 2002-04-30 18:08 UTC (permalink / raw)


From: dmjones [mailto:derek@NOSPAMknosof.co.uk]

> Who mentioned safe and correct?  This is avoiding the base
> issue.  Where is the evidence of a worthwhile cost/benefit
> for strong typing?

If you can't grasp the connection between "safe and correct"
and "cost/benefit", then everyone is wasting their time
discussing it with you.  It is a fundamental key point.

I haven't seen any research lately on the benefits of strong
typing.  Why should there be any, since most of the C/C++
camps, and other loosely typed languages, don't care?  That's
why you end up with products like Windows that are expected
to crash frequently.  And they don't care, because they'll
just charge you for an upgrade to fix things that shouldn't
have been there in the first place.  And that's also why you 
don't see Microsoft products user in life-and-death situations.

Does anybody remember the link to the site/agency that forbade
C from being used on mission critical or safety critical systems?
They had a paper on the site the went into the reasons.  Most of
them, even if not explicitly stated, where strong typing issues.
It's been several years since I read it, and I can't remember
where.



^ permalink raw reply	[flat|nested] 166+ messages in thread
* RE: Is strong typing worth the cost?
@ 2002-04-29 19:21 Beard, Frank [Contractor]
  2002-04-29 20:15 ` dmjones
  0 siblings, 1 reply; 166+ messages in thread
From: Beard, Frank [Contractor] @ 2002-04-29 19:21 UTC (permalink / raw)


This will be very difficult to get an apples to apples
comparison, because the group that is not allowed to use
subranges or subtypes should also suppress range checking.
Because then they will have to program in all the necessary
checking to prevent erroneous results.  The group that uses
subtypes/subranges will mean they had to spend some time
in some up front analysis, where the unprotected group will
not.

The fun will begin when your test data contains out of
range values and the unprotected group starts producing
all type of erroneous results, which will take hours, or
days, if ever, to uncover, where the strongly type group
will find it in minutes.

Unless what you're really talking about is comparing the use
of parent types to subtypes.  In this case, you sort of in
the in-between realm.  You have range checking for when you
go outside the parent range, but then you still have to
manually code in the sub-range protection.

How are you going to determine that the unprotected group
programmed all the necessary checking?  Are you going to
have some type of code analysis software to check it out?
This will have a huge impact on downstream maintenance.

Frank

-----Original Message-----
From: dmjones [mailto:derek@NOSPAMknosof.co.uk]
Sent: Monday, April 29, 2002 2:38 PM
To: comp.lang.ada@ada.eu.org
Subject: Re: Is strong typing worth the cost?


Ted,
 
>> I have been trying to locate evidence that the cost of the use
>> of strong typing is repaid by a greater benefit.
> 
> There was a study done on compiler software by Rational. It showed
> something like 2x productivity for Ada over C, with the credit being
> laid at least partially on Ada's strong typing. It should be available
> somewhere on their website, but you'll probably have to search for it.

Thanks for the reference.  But I my interest is purely in
the advantages of strong typing.  Language comparison is too
broad an issue.

The experiment I had in mind was two set of subjects, all
working on the same Ada program.  However, one set of subjects
is not allowed to use subranges or subtypes. All objects
holding integer values have integer type.  The other
set of subjects would be able to create as many different
integer types as they liked.

How long would each group of subjects take to complete their
tasks, and what would down stream maintenance costs be (for
programs created by each set of subjects)
?
_______________________________________________
comp.lang.ada mailing list
comp.lang.ada@ada.eu.org
http://ada.eu.org/mailman/listinfo/comp.lang.ada



^ permalink raw reply	[flat|nested] 166+ messages in thread
* Is strong typing worth the cost?
@ 2002-04-28 17:07 dmjones
  2002-04-29 15:22 ` Ted Dennison
                   ` (3 more replies)
  0 siblings, 4 replies; 166+ messages in thread
From: dmjones @ 2002-04-28 17:07 UTC (permalink / raw)


All,

I have been trying to locate evidence that the cost of the use
of strong typing is repaid by a greater benefit.

Now we all know, from first hand experience, the benefits of
strong type checking.  But where is the experimental proof?
I know of two studies:

A Controlled experiment to assess the benefits of procedure
argument type checking, by Prechelt & Tichy, IEEE Trans on
Software Engineering Vol 24, no 4. 302-312.

An Experimental evaluation of data type conventions, by Gannon,
CACM Vol 20, no 8. 584-595.

Both studies used student subjects, not the one most likely
to have had lots of experience structuring a program using types.
One study also used C, which is strongly typed if compared
to assembler.

So where are the studies showing that strong typing in Ada (or
Pascal) saves money/time, creates more reliable programs, etc?

References anybody?



^ permalink raw reply	[flat|nested] 166+ messages in thread

end of thread, other threads:[~2002-05-28 15:26 UTC | newest]

Thread overview: 166+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-29 23:26 Is strong typing worth the cost? Beard, Frank [Contractor]
  -- strict thread matches above, loose matches on Subject: below --
2002-04-30 21:34 Gralia, Mars  J.
2002-04-30 20:32 Beard, Frank [Contractor]
2002-04-30 18:08 Beard, Frank [Contractor]
2002-05-01 11:07 ` David Gillon
2002-04-29 19:21 Beard, Frank [Contractor]
2002-04-29 20:15 ` dmjones
2002-04-28 17:07 dmjones
2002-04-29 15:22 ` Ted Dennison
2002-04-29 15:53   ` Pat Rogers
2002-04-29 18:37   ` dmjones
2002-04-29 18:50     ` Pat Rogers
2002-04-29 19:00     ` Darren New
2002-04-30 11:50     ` Marc A. Criley
2002-04-30 13:24       ` dmjones
2002-04-30 15:03         ` Jim Rogers
2002-04-30 16:48           ` dmjones
2002-04-30 17:45             ` Marin David Condic
2002-05-01 21:36               ` Brian Gaffney
2002-04-30 18:20             ` tmoran
2002-04-30 19:00               ` Marin David Condic
2002-05-01 15:20                 ` dmjones
2002-05-01 16:07                   ` Marin David Condic
2002-05-02  5:00                     ` Simon Wright
2002-05-02  7:55                   ` Martin Dowie
2002-05-01 16:51                 ` Darren New
2002-05-01 17:25                   ` Marin David Condic
2002-05-02 16:09                     ` Darren New
2002-05-03 13:46                       ` Marin David Condic
2002-05-03 22:54                         ` Darren New
2002-05-01 18:22                 ` tmoran
2002-05-01 18:50                   ` Marin David Condic
2002-05-01 20:30                   ` Dan Andreatta
2002-05-01 21:47                     ` Larry Kilgallen
2002-05-02 15:43                     ` Wes Groleau
2002-04-30 19:01             ` Preben Randhol
2002-04-30 19:28               ` Preben Randhol
2002-04-30 20:20                 ` Marin David Condic
2002-05-01  8:36                   ` Pascal Obry
2002-05-01 11:50                     ` Gary Scott
2002-05-01 13:39                       ` Marin David Condic
2002-05-02  2:24                         ` Darren New
2002-05-02 15:47                           ` Wes Groleau
2002-05-02 16:37                             ` Darren New
2002-05-02 19:59                               ` Chad R. Meiners
2002-05-02 21:48                                 ` Darren New
2002-05-02 22:16                                   ` Wes Groleau
2002-05-02 23:52                                     ` Darren New
2002-05-03  0:17                                       ` Aidan Skinner
2002-05-03  0:31                                         ` Aidan Skinner
2002-05-03 15:10                                       ` Wes Groleau
2002-05-03 16:06                                         ` Darren New
2002-05-06 16:37                                           ` Wes Groleau
2002-05-06 17:40                                             ` Darren New
2002-05-07  2:06                                               ` tmoran
2002-05-07 15:21                                                 ` Darren New
2002-05-07 19:11                                                   ` Preben Randhol
2002-05-03 15:31                                       ` Wes Groleau
2002-05-03 16:21                                         ` Darren New
2002-05-06 15:33                                           ` Wes Groleau
2002-05-06 16:30                                             ` Darren New
2002-05-03 15:38                                       ` Wes Groleau
2002-05-03 16:07                                         ` Marin David Condic
2002-05-03 19:51                                       ` Randy Brukardt
2002-05-03 20:55                                         ` Ed Falis
2002-05-04 16:34                                           ` Brian Rogoff
2002-05-03  0:22                                   ` Chad R. Meiners
2002-05-03  0:48                                     ` Darren New
2002-05-03 12:11                                       ` Chad R. Meiners
2002-05-03 14:27                                         ` Marin David Condic
2002-05-04  0:23                                           ` Darren New
2002-05-06 17:54                                             ` Marin David Condic
2002-05-07 15:28                                               ` Darren New
2002-05-07 17:54                                                 ` Chad R. Meiners
2002-05-03 14:01                           ` Marin David Condic
2002-05-03 23:41                             ` Gary Scott
2002-05-06 18:05                               ` Marin David Condic
2002-05-01 14:19                       ` Pascal Obry
2002-05-01 13:27                     ` Marin David Condic
2002-05-01 14:28                     ` Wes Groleau
2002-05-01 15:25                       ` Marin David Condic
2002-05-02 15:51                       ` Wes Groleau
2002-05-02 16:47                         ` Gary Scott
2002-05-02 18:24                           ` Preben Randhol
2002-05-02 18:48                             ` Dan Nagle
2002-05-03  8:44                               ` Preben Randhol
2002-05-03 10:17                                 ` Gary Scott
2002-05-03 10:48                                   ` Preben Randhol
2002-05-03 13:13                                     ` Gary Scott
2002-05-03 14:40                                       ` Preben Randhol
2002-05-03 14:32                                 ` Dan Nagle
2002-05-02 17:26                         ` Larry Hazel
2002-05-02 18:12                           ` Wes Groleau
2002-05-02 18:40                             ` Preben Randhol
2002-05-02 21:54                               ` Wes Groleau
2002-05-02 18:54                           ` Gary Scott
2002-05-02 21:56                             ` Wes Groleau
2002-05-26 17:56                           ` Robert I. Eachus
2002-05-26 22:04                             ` Brian Rogoff
2002-05-27 23:26                               ` Robert I. Eachus
2002-05-28 15:26                             ` Marin David Condic
2002-05-02 11:30                     ` Larry Kilgallen
     [not found]                     ` <3CCFD76A.A60BB9Organization: LJK Software <Sb8D81Zz$HcE@eisner.encompasserve.org>
2002-05-02 16:12                       ` Darren New
2002-04-30 21:17             ` Jim Rogers
2002-04-30 21:30               ` Darren New
2002-05-07 12:17           ` Colin Paul Gloster
2002-05-07 22:11             ` Hyman Rosen
2002-04-30 15:39         ` Marin David Condic
2002-05-01 14:39           ` Wes Groleau
2002-05-01 15:42             ` Marin David Condic
2002-05-02 20:17               ` Jeffrey Carter
2002-05-03 14:40                 ` Marin David Condic
2002-05-26 16:51               ` Robert I. Eachus
2002-05-28 15:16                 ` Marin David Condic
2002-04-30 17:02         ` Chad R. Meiners
2002-04-30 17:27           ` Darren New
2002-04-30 20:15             ` Chad R. Meiners
2002-04-30 20:42               ` Marin David Condic
2002-05-02 12:00                 ` Marc A. Criley
2002-05-02 15:20                   ` Larry Kilgallen
2002-05-02 16:19                   ` Darren New
2002-05-03 14:44                   ` Marin David Condic
2002-04-30 21:40               ` Darren New
2002-04-30 21:43             ` tmoran
2002-04-30 22:38               ` Darren New
2002-04-30 18:04           ` Marin David Condic
2002-04-30 17:27         ` Jeffrey Carter
2002-04-30 17:35         ` Marc A. Criley
2002-05-01  4:01         ` Richard Riehle
2002-04-29 16:02 ` Marin David Condic
2002-05-01  0:31 ` dmjones
2002-05-01  8:05   ` Preben Randhol
2002-05-01  8:07   ` Preben Randhol
2002-05-01 14:32   ` Mike Silva
2002-05-01 15:52     ` Marin David Condic
2002-05-02 16:17     ` Wes Groleau
2002-05-02 18:53       ` tmoran
2002-05-02 18:58         ` Pat Rogers
2002-05-01 15:35   ` Jim Rogers
2002-05-01 16:17     ` Marin David Condic
2002-05-01 18:42     ` dmjones
2002-05-01 20:12       ` Dan Andreatta
2002-05-01 20:19       ` Darren New
2002-05-01 22:17         ` Jeffrey Carter
2002-05-02 16:18           ` Wes Groleau
2002-05-01 21:46       ` Larry Kilgallen
2002-05-01 22:21       ` Jeffrey Carter
2002-05-02 11:28         ` John English
2002-05-02 16:18           ` Darren New
2002-05-02 16:41             ` Larry Kilgallen
2002-05-02 18:28               ` Preben Randhol
2002-05-02 19:53                 ` Larry Kilgallen
2002-05-03 12:12                 ` Andrzej Filip
2002-05-03 10:14             ` Georg Bauhaus
2002-05-26 22:46               ` Robert I. Eachus
2002-05-27  8:10           ` Florian Weimer
2002-05-01 22:47       ` Jim Rogers
2002-05-01 16:32   ` Jeffrey Carter
2002-05-01 17:59     ` Marin David Condic
2002-05-01 19:08     ` Wes Groleau
2002-05-01 21:10   ` Brian Gaffney
2002-05-03  2:45 ` dmjones
2002-05-03  7:59   ` Martin Dowie
2002-05-03  8:43     ` Preben Randhol
2002-05-03  8:55       ` Martin Dowie
2002-05-03  8:51   ` Preben Randhol

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox