bye...

Roel Wuyts roel.wuyts at iam.unibe.ch
Mon Mar 10 17:18:21 UTC 2003


Hmm, I thought that C++ was strongly typed, so I looked around a bit.

For me, strong typing means that there is a strict enforcement of type 
rules, with no exceptions, and that everything has one type and one 
type only, that cannot change during the lifetime.

C++ violates this principle only because of the coercion for numeric 
values, E.g.

           int a = 5;
           float b = a;

and because they allow ignore typedefs for the purposes of type 
comparison; for example the following is allowed, which would probably 
be disallowed in a strongly typed language:

           typedef int Date;    /* Type to represent a date */
           Date a = 12345;
           int b = a;       /* What does the coder intend? */


On Monday, March 10, 2003, at 05:41 PM, Ned Konz wrote:

> On Monday 10 March 2003 08:30 am, Jarvis, Robert P. (Contingent)
> wrote:
>> I suggest that we not confuse "strong typing" with "static typing".
>> Smalltalk is not statically typed, but it is strongly typed.  Java
>> and C++ (to the best of my knowledge) are both strongly and
>> statically typed.
>>
>> In my opinion
>>
>>         "Strong typing" is good,
>>         "Static typing" is bad,
>>         "Garbage collection" is good
>>
>> for the types of work I usually do.  Your mileage may vary.
>
> C++ is not usually strongly typed. There is some support for type IDs
> but they aren't universal.
>
> I'm still amazed that there aren't more people using garbage
> collectors with C++, considering that there are some excellent ones
> available.
>
> -- 
> Ned Konz
> http://bike-nomad.com
> GPG key ID: BEEA7EFE
>
>
Roel Wuyts                                                   Software 
Composition Group
roel.wuyts at iam.unibe.ch                       University of Bern, 
Switzerland
http://www.iam.unibe.ch/~wuyts/
Board Member of the European Smalltalk User Group: www.esug.org



More information about the Squeak-dev mailing list