Strong static typing does not work 
Author Message
 Strong static typing does not work

In the JDK 1.2.2 docs I found the most amazing statement about the
Collections API: "Doug Lea, who wrote a popular Java collections package
that did reflect mutability distinctions in its interface hierarchy, no
longer believes it is a viable approach, based on user experience with
his collections package. In his words (from personal correspondence)
"Much as it pains me to say it, strong static typing does not work for
collection interfaces in Java."
This exactly what the Smalltalk community has been saying since the
inception of Java that static typing just gets in the way. I would go
further and say that strong static typing doesn't work whenever you are
trying to do any type of generic programming.

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Wed, 18 Jun 1902 08:00:00 GMT  
 Strong static typing does not work

batyas> This exactly what the Smalltalk community has been saying
batyas> since the inception of Java that static typing just gets in
batyas> the way. I would go further and say that strong static typing
batyas> doesn't work whenever you are trying to do any type of generic
batyas> programming.

Or put another way, I think I hear you saying:

        "Strong Static Typing inhibits full re-use".

In other words, whatever Strong Static Typing would save in debug
time by catching inappropriate use of parameters, it kills in overall
programmer time by preventing re-use of proven modules.

Cool... it's nice to have that as a good meme to throw at the "types"
camp.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095

Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Wed, 18 Jun 1902 08:00:00 GMT  
 Strong static typing does not work

Quote:
>In the JDK 1.2.2 docs I found the most amazing statement about the
>Collections API: "Doug Lea, who wrote a popular Java collections package
>that did reflect mutability distinctions in its interface hierarchy, no
>longer believes it is a viable approach, based on user experience with
>his collections package. In his words (from personal correspondence)
>"Much as it pains me to say it, strong static typing does not work for
>collection interfaces in Java."

I beleive you

Quote:
>This exactly what the Smalltalk community has been saying since the
>inception of Java that static typing just gets in the way. I would go
>further and say that strong static typing doesn't work whenever you are
>trying to do any type of generic programming.

This is of course one pile of bulls**t. If you rephrase your sentence
allong the following way:

"primitive pseudo-strong static typing (a la Java) doesn't work whenever
you are trying to do any type of generic programming"

I may follow you well. And if you would have followed the discussion
crossposted between c.l.f. and c.l.s., you'd be a little more nuanced.

sigh..., leave it, I don't even think it's worth talking about

regards,

        Simon

PS: as I'm offline the next 3 weeks, so I won't get involved in a
discussion (if there is one ;-)



Wed, 18 Jun 1902 08:00:00 GMT  
 Strong static typing does not work



Quote:
> Or put another way, I think I hear you saying:

>         "Strong Static Typing inhibits full re-use".

> In other words, whatever Strong Static Typing would save in debug
> time by catching inappropriate use of parameters, it kills in overall
> programmer time by preventing re-use of proven modules.

Not quite, Strong Static Typing can be useful if it is not enforced, or
is an advisory adjunct.

--
Terry
===========================================================
Terry Raymond       Smalltalk Professional Debug Package
Crafted Smalltalk   *Breakpoints* and *Watchpoints* for
19 Tilley Ave.                  VW and ENVY/Developer
Newport, RI  02840

http://www.craftedsmalltalk.com
===========================================================



Wed, 18 Jun 1902 08:00:00 GMT  
 Strong static typing does not work


Quote:

> batyas> This exactly what the Smalltalk community has been saying
> batyas> since the inception of Java that static typing just gets in
> batyas> the way. I would go further and say that strong static typing
> batyas> doesn't work whenever you are trying to do any type of generic
> batyas> programming.

> Or put another way, I think I hear you saying:

>         "Strong Static Typing inhibits full re-use".

> In other words, whatever Strong Static Typing would save in debug
> time by catching inappropriate use of parameters, it kills in overall
> programmer time by preventing re-use of proven modules.

> Cool... it's nice to have that as a good meme to throw at the "types"
> camp.

Well don't throw it at the FP camp just yet. Their type system is a lot more
sophisticated, and I don't think anyone has demonstrated that their approach
has the same flaws as Java et al. Whether you feel this is true or not, I
haven't seen any proof and no one appears to have any.


Wed, 18 Jun 1902 08:00:00 GMT  
 Strong static typing does not work



Quote:
>> Or put another way, I think I hear you saying:

>> "Strong Static Typing inhibits full re-use".

>> In other words, whatever Strong Static Typing would save in debug
>> time by catching inappropriate use of parameters, it kills in overall
>> programmer time by preventing re-use of proven modules.

Terry> Not quite, Strong Static Typing can be useful if it is not enforced, or
Terry> is an advisory adjunct.

Ahh, yeah, that'd be something I could support.  But there needs to be
ways that I can say "this can be anything that responds to the same
protocol as that class, even if it doesn't inherit from that class or
even if I didn't finish developing that class yet or even if the user
created that class later" :-).

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095

Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Wed, 18 Jun 1902 08:00:00 GMT  
 Strong static typing does not work
That was my point, I thought it was clear I was talking about Java style
typing.
In article

g.de>,

Quote:

> >In the JDK 1.2.2 docs I found the most amazing statement about the
> >Collections API: "Doug Lea, who wrote a popular Java collections
package
> >that did reflect mutability distinctions in its interface hierarchy,
no
> >longer believes it is a viable approach, based on user experience
with
> >his collections package. In his words (from personal correspondence)
> >"Much as it pains me to say it, strong static typing does not work
for
> >collection interfaces in Java."

> I beleive you

> >This exactly what the Smalltalk community has been saying since the
> >inception of Java that static typing just gets in the way. I would go
> >further and say that strong static typing doesn't work whenever you
are
> >trying to do any type of generic programming.

> This is of course one pile of bulls**t. If you rephrase your sentence
> allong the following way:

> "primitive pseudo-strong static typing (a la Java) doesn't work
whenever
> you are trying to do any type of generic programming"

> I may follow you well. And if you would have followed the discussion
> crossposted between c.l.f. and c.l.s., you'd be a little more nuanced.

> sigh..., leave it, I don't even think it's worth talking about

> regards,

>    Simon

> PS: as I'm offline the next 3 weeks, so I won't get involved in a
> discussion (if there is one ;-)

Sent via Deja.com http://www.deja.com/
Before you buy.


Wed, 18 Jun 1902 08:00:00 GMT  
 Strong static typing does not work

Quote:

> In the JDK 1.2.2 docs I found the most amazing statement about the
> Collections API: "Doug Lea, who wrote a popular Java collections package
> that did reflect mutability distinctions in its interface hierarchy, no
> longer believes it is a viable approach, based on user experience with
> his collections package. In his words (from personal correspondence)
> "Much as it pains me to say it, strong static typing does not work for
> collection interfaces in Java."

The "in Java" part is critical. Most Java advocates agree the language is
currently weak in this area, and there are changes afoot in Sun's
Community Process to fix it (by making the static type system more
powerful, not by shifting to dynamic checks). See
http://java.sun.com/aboutJava/communityprocess/jsr/jsr_014_gener.html.

The "mutability distinctions" part is also worth noting. Static type
checking isn't a binary, all-or-nothing thing. You can check some things
and not others. For example, Java checks exceptions thrown but doesn't
have the "const" type-operator. C++ doesn't check exceptions statically,
but does have "const". Perhaps static checking of mutability distinctions
is not worth while but other static checks are.

Quote:
> This exactly what the Smalltalk community has been saying since the
> inception of Java that static typing just gets in the way.

No, what Doug Lea is saying is far more specific than your sweeping
generalisation. You are not saying "exactly" the same thing.

  Dave Harris, Nottingham, UK | "Weave a circle round him thrice,

                              |  For he on honey dew hath fed
 http://www.bhresearch.co.uk/ |   And drunk the milk of Paradise."



Wed, 18 Jun 1902 08:00:00 GMT  
 Strong static typing does not work

How much can they change without

-- changing the VM, which Sun seems very reluctant to do
-- getting rid of the 'primitive' types

Generics are always going to be a problem with the primitive types being
there.  With the Java VM effectively frozen (by Sun's decision process,
not by any other reason), how much progress can be made on fundamental
issues ?

Quote:
> The "in Java" part is critical. Most Java advocates agree the language is
> currently weak in this area, and there are changes afoot in Sun's
> Community Process to fix it (by making the static type system more
> powerful, not by shifting to dynamic checks). See
> http://java.sun.com/aboutJava/communityprocess/jsr/jsr_014_gener.html.

--
James A. Robertson
Senior Sales Engineer
Cincom Systems, Inc.

Talk Small and Carry a Big Class Library



Wed, 18 Jun 1902 08:00:00 GMT  
 Strong static typing does not work

: The "mutability distinctions" part is also worth noting. Static type
: checking isn't a binary, all-or-nothing thing. You can check some
: things and not others. For example, Java checks exceptions thrown
: but doesn't have the "const" type-operator. C++ doesn't check
: exceptions statically, but does have "const". Perhaps static
: checking of mutability distinctions is not worth while but other
: static checks are.

Doug Lea's collections did not require a "const" keyword. His types
had interfaces for constant methods and then derived from them were
interfaces that added destructive methods. I used these a little and
thought it worked fine. I never read an explanation of the trouble
people found with them. The "official" Sun collections are certainly a
step backward in several directions.

Ob. Smalltalk - The Sun collections were designed in ignorance of
Smalltalk and Common Lisp, both had a long history of successful
collections APIs.

--



Wed, 18 Jun 1902 08:00:00 GMT  
 Strong static typing does not work

: Generics are always going to be a problem with the primitive types
: being there.

Yes. The leading proposal for generic types does not support primitive
types. And it does not support making primitive operators (e.g. +, -,
...) available to Object types. Operators and stack-allocated "value"
objects is being discussed for even further down the road.

--



Wed, 18 Jun 1902 08:00:00 GMT  
 Strong static typing does not work

Quote:



>Not quite, Strong Static Typing can be useful if it is not enforced, or
>is an advisory adjunct.

Having come from the Objective-C camp many years ago, there was a time when
I definitely agreed with this sentiment (Objective-C allows both dynamic
(ala Smalltalk) as well as static typing, and I used to use them both).

However, now I am of the opinion that, even in an advisory capacity, it
would not be terribly useful.  It would probably be something like the
onslaught of Transcript messages that you always see-- I guess I've finally
reached the point where I generally ignore them.

Possibly I could be swayed into once more believing that typing advice would
be useful, but I kind of doubt it.

Nevin Pratt



Wed, 18 Jun 1902 08:00:00 GMT  
 Strong static typing does not work

Quote:



> >Not quite, Strong Static Typing can be useful if it is not enforced, or
> >is an advisory adjunct.

> Having come from the Objective-C camp many years ago, there was a time when
> I definitely agreed with this sentiment (Objective-C allows both dynamic
> (ala Smalltalk) as well as static typing, and I used to use them both).

> However, now I am of the opinion that, even in an advisory capacity, it
> would not be terribly useful.  It would probably be something like the
> onslaught of Transcript messages that you always see-- I guess I've finally
> reached the point where I generally ignore them.

I would rather it be a separate tool like lint, then it would generate a report
in a separate window and not clutter up the transcript.

Quote:
> Possibly I could be swayed into once more believing that typing advice would
> be useful, but I kind of doubt it.

Well, I admit I have never used such a system so I don't know how it would
turn out in actual practice.  One problem I can see is that the type information
would probably be defined after the code was written, and when people leave
this sort of task to the end it frequently does not get properly done.  However,
if it was considered to be part of a testing regime then it may work.
Additionally,
tools that do type inferencing could make the task more palatable.

I think its biggest use would not be catching errors with the original code but
in maintenance when you have to modify someone else's code.  Knowing the
 actual type of an object could really make the process a lot easier.

--
Terry
===========================================================
Terry Raymond       Smalltalk Professional Debug Package
Crafted Smalltalk   *Breakpoints* and *Watchpoints* for
19 Tilley Ave.                  VW and ENVY/Developer
Newport, RI  02840

http://www.craftedsmalltalk.com
===========================================================



Wed, 18 Jun 1902 08:00:00 GMT  
 Strong static typing does not work

Quote:

> >This exactly what the Smalltalk community has been saying since the
> >inception of Java that static typing just gets in the way. I would go
> >further and say that strong static typing doesn't work whenever you are
> >trying to do any type of generic programming.

Can you elaborate? C++ is statically typed, but supports generic
programming. Or are you talking about typing of template parameters?

Thanks,

Martijn



Wed, 18 Jun 1902 08:00:00 GMT  
 Strong static typing does not work

Quote:
> How much can they change without

> -- changing the VM, which Sun seems very reluctant to do
> -- getting rid of the 'primitive' types

A lot. Consider JPython, a JVM implementation of a Smalltalk-like
dynamically type-checked language with no primitives. For some benchmarks
it runs faster than the tradition C implementation.

I don't know what will happen with primitives in the long run. In the
short run they will probably be ignored by the genericity proposals. There
is other discussion of user-defined value types and operator overloading,
which we can hope will eventually lead to the primitive types becoming
redundant. I sometimes think Java is going to spend the next 10-15 years
catching up with where Eiffel was 10 years ago.

Anyway, I didn't mean to come across as a general Java advocate. I was
commenting about static type checking. Java's brain-dead primitive system
is beside the point.

  Dave Harris, Nottingham, UK | "Weave a circle round him thrice,

                              |  For he on honey dew hath fed
 http://www.bhresearch.co.uk/ |   And drunk the milk of Paradise."



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 30 post ]  Go to page: [1] [2] [3]

 Relevant Pages 

1. Flying With Python (Strong versus Weak Typing) [actually, Static vs Dynamic typing]

2. R5RS on static/dynamic and strong/weak typing

3. Strong type checking ... (not really)

4. Types, types: static vs. dynamic -- classification

5. Types, types: static vs. dynamic --

6. Types, types: static vs. dynamic -- classification

7. x/0 as a type error [Extremely static typing]

8. opacity and static typing (Re: Type checkers for scheme)

9. Types, types: static vs. dynamic -- classification

10. Provide an option: static typing + type inference ?

11. Typing the Euro symbol does not work

 

 
Powered by phpBB® Forum Software