Search the web
Sign In
New User? Sign Up
testdrivendevelopment · Test-driven Development
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Re: [TDD] Strong Typing vs Strong Testing (was: .NET Properties V i   Message List  
Reply | Forward Message #11313 of 32011 |
Re: [TDD] Strong Typing vs Strong Testing (was: .NET Properties V iolate YAGNI?)

From: "Bayley, Alistair"
<alistair_bayley.at.ldn.invesco.com@...>
To: "'testdrivendevelopment@yahoogroups.com'"
<testdrivendevelopment.at.yahoogroups.com@...>
Sent: Friday, September 09, 2005 7:08 AM
Subject: RE: [TDD] Strong Typing vs Strong Testing (was: .NET Properties V
iolate YAGNI?)


>> From: Frank Mueller [mailto:frank@...]
>>
>> The examples are Smalltalk, Ruby and Python. My intend was to
>> show, that a compile-time
>> type checking needs the information about the types inside
>> the source code for this
>> checking. Chicking at runtime doesn't need this information here.
>
> Compile-time type checking does not *require* type annotations. Many
> languages (Java, C++, C#, etc) demand them, and this is a source of pain
> for
> some people. But you can have compile-time type checking without type
> annotations via type inference; Haskell, ML, Ocaml, and some Scheme
> systems
> have this.

This is about the fifth time you have made that assertion. As far
as I can tell, ***all*** type checking systems need help from
the program author at some time or other in all but the simplest
cases, and ***no*** compile time type checking system smoothly
and transparently covers what developers actually want to, and
need to, do in a program.

My personal opinion is that arguing over the merits of manifest
versus implied, compile time versus dynamic, strong versus
weak or any of the other distinctions between different styles
of type checking is a bit like arguing the distinctions between
protein heavy, carbohydrate heavy, fats and fibre diets when
the man is lying there starving to death.

Too many years ago I had a teacher who would ramble on
about the 1/4 inch drill story. He'd tell us that he had been
a purchaseing manager for a hardware chain, and how many
1/4 inch drills they had sold the previous year. Etc. And then
he'd say he had never met a customer who wanted 1/4 inch
drills. What they really wanted was 1/4 inch holes!

I've never seen a working developer who wanted a type
checking system. I've seen lots of developers who wanted
good support for writing programs with low levels of
defects.

The best type system in the world is not going to help if
you haven't started out by identifying the *distinct* domain
concepts that really have to stay distinct and encapsulated
them in a way that the type system can *then* check that
they're used in a sane way.

There's a very simple thing that Java and similar languages
that use manifest typing could do to help this along. It's
so simple that I predict you won't see it in any mainline
language in the next decade (although you might see it
as an option in a high-end IDE).

Provide a switch that causes a compile error if any of
the fundamental types or fundamental libraries are used
without the "private" scope.

It's that simple: the fundamental language types, and
the basic language libraries, do not, and let me repeat
that, do not represent any concepts that your application
actually needs. At best they represent bizzare
oversimplifications of those concepts that can't be told
apart by the type checking mechanism.

There's a concept in American law, and I presume
in many other legal systems, called the attractive
nuisance. A nuisance is, of course, something harmful,
and attractive has its usual meaning. The story I heard
to illustrate the point was a company that had a nice
concrete lined open vat of some form of acid that looked
like water. It was, of course, surrounded by a fence and
warning signs. That didn't stop several small boys who
wanted a swim on a hot day.

Arguing about whose type system is better without
looking at what those type systems actually do to
support real program correctness doesn't advance
the art of writing low defect programs one iota.

And that's my say on the matter.

John Roth







>
> Alistair
>
> -----------------------------------------
> *****************************************************************
> Confidentiality Note: The information contained in this message, and any
> attachments, may contain confidential and/or privileged material. It is
> intended solely for the person(s) or entity to which it is addressed.
> Any
> review, retransmission, dissemination, or taking of any action in
> reliance upon this information by persons or entities other than the
> intended recipient(s) is prohibited. If you received this in error,
> please
> contact the sender and delete the material from any computer.
> *****************************************************************
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>




Fri Sep 9, 2005 2:45 pm

jhrothjr
Offline Offline
Send Email Send Email

Forward
Message #11313 of 32011 |
Expand Messages Author Sort by Date

... We could ask him, but it seems hard for me to believe that anyone as smart as Bruce could believe that. My guess is that he finds that run-time checking is...
Ron Jeffries
ronaldejeffries
Offline Send Email
Sep 9, 2005
12:52 pm

From: "Bayley, Alistair" <alistair_bayley.at.ldn.invesco.com@...> To: "'testdrivendevelopment@yahoogroups.com'" ...
yahoogroups@...
jhrothjr
Offline Send Email
Sep 9, 2005
4:39 pm

... Or a code rule ? When we implemented support for generics in our tool recently there were way-too-many-to-count places in the code that treated class names...
Kevin Lawrence
kevinwilliam...
Online Now Send Email
Sep 9, 2005
5:08 pm

... While this is indeed true, type inferencing is a way to reduce the amount of hand holding that you need to do for the compiler. Cat c = new Cat(); c = new...
ayende_tdd
Offline Send Email
Sep 10, 2005
12:02 am

... And to prove the casting requirement to be really stupid: What if the animal is not a Cat? The compiler will happily build the first line, even when "cat"...
Thomas Eyde
thomas_eyde
Offline Send Email
Sep 10, 2005
7:28 pm

Hi Thomas, ... Not sure if I get what you mean here. If zoo.GetAnimal is declared to return an Object or an Animal, then I just as obviously want it to be an...
Charlie Poole
cpoole98370
Offline Send Email
Sep 11, 2005
10:15 am

... In this particular case, I know that it's going to return a cat, I'm placing it in a cat var, so it's obviously either a cast error or success. ... A...
Ayende Rahien
ayende_tdd
Offline Send Email
Sep 11, 2005
10:38 am

Hi, I see your point here, I just thought we were getting a little confused in the language, where "cast" can mean (1) the syntactic expression we use to tell...
Charlie Poole
cpoole98370
Offline Send Email
Sep 11, 2005
11:03 am

I'm talking about the code that I've to write. It should definitely preserve type checking, yes....
Ayende Rahien
ayende_tdd
Offline Send Email
Sep 11, 2005
11:08 am

... Thanks for clearing that up. I was also talking about the code I have to write. BTW, C# has an "as" operator. Feel free to add an extra "s" to that, ...
Thomas Eyde
thomas_eyde
Offline Send Email
Sep 11, 2005
11:34 pm

Actually, I think that it's the usage that is objectionable. Not the operator itself. It has valid usages....
Ayende Rahien
ayende_tdd
Offline Send Email
Sep 12, 2005
12:24 am

... Alistair, This is a typical argument for compile-time checking, but I think it rests on an incorrect assumption: that because code is compiled before it...
Colin Putney
cw_putney
Offline Send Email
Sep 9, 2005
12:30 pm

From: testdrivendevelopment@yahoogroups.com [mailto:testdrivendevelopment@yahoogroups.com] On Behalf Of Colin Putney ... In the even more extreme case, you...
mark
markwilden
Offline Send Email
Sep 12, 2005
4:21 pm

... Hello Frank. This example doesn't appear to have much to do with run-time vs compile-time type-checking. The Smalltalk code is shorter because you can pass...
Bayley, Alistair
abayley2
Offline Send Email
Sep 9, 2005
12:43 pm

Hi Alistair ... ... The examples are Smalltalk, Ruby and Python. My intend was to show, that a compile-time type checking needs the information about the types...
Frank Mueller
frank_muelle...
Offline Send Email
Sep 9, 2005
12:56 pm

... Compile-time type checking does not *require* type annotations. Many languages (Java, C++, C#, etc) demand them, and this is a source of pain for some...
Bayley, Alistair
abayley2
Offline Send Email
Sep 9, 2005
1:09 pm

On Sep 9, 2005, at 2:13 AM, Bayley, Alistair wrote: ... ... Except that compile-link times for common languages like C++ are so slow, and the equivalent for...
Keith Ray
attkeithray
Offline Send Email
Sep 9, 2005
2:35 pm

... Sure. I'm assuming that I'd be using a fast computer and a fast compiler which supports separate compilation, so that (1) I can compile a module at a time...
Bayley, Alistair
abayley2
Offline Send Email
Sep 9, 2005
3:12 pm

... This is a truly novel argument in favor of Smalltalk which I don't think I've seen articulated much: Use Smalltalk because you don't need the fastest,...
Doug Swartz
gruverguy
Offline Send Email
Sep 10, 2005
1:38 pm

I'm currently using gcc for Objective-C++. Even though compiling a single file might be almost instant, the link phase takes over one minute. This can be...
Keith Ray
attkeithray
Offline Send Email
Sep 10, 2005
1:45 pm

... That's terrible! Do you have to wait that long after every change you make, no matter how small, before you are able to run the program? - Peter Gummer...
Peter Gummer
peter_gummer
Offline Send Email
Sep 10, 2005
3:14 pm
 First  |  |  Next > Last 
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help