From: BrianG on
Martin Krischik wrote:
> Am 15.04.2010, 10:59 Uhr, schrieb J-P. Rosen <rosen(a)adalog.fr>:
>
>> "C++ is a strongly typed language, if conversions between logically
>> unrelated types are avoided".
>
> Driving without seatbelts is perfectly save if accidents are avoided.
>
> Martin


"English is an unambiguous language, if ambiguous statements are avoided."

"<The programming language of your choice> creates bug-free software,
if bugs are avoided."

--BrianG
--The cosmic is largely comic
From: Martin Krischik on
Am 16.04.2010, 02:22 Uhr, schrieb BrianG <briang000(a)gmail.com>:

> "<The programming language of your choice> creates bug-free software,
> if bugs are avoided."

The C / C++ community actually uses this as a serious argument in favour
of there language.

Martin
--
Martin Krischik
From: J-P. Rosen on
Maciej Sobczak a �crit :
> On 15 Kwi, 10:59, "J-P. Rosen" <ro...(a)adalog.fr> wrote:
>
>> "C++ is a strongly typed language, if conversions between logically
>> unrelated types are avoided".
>>
>> Ain't that cute?
>
> http://en.wikipedia.org/wiki/Strong_typing
>
> "these terms have been given such a wide variety of meanings over the
> short history of computing that it is often difficult to know, out of
> context, what an individual author means when using them."
Of course, there is obviously no clear-cut

[...]
> The statement that you cited is therefore not very convincing.
>
> In particular, what are "conversions between logically unrelated
> types"?
> Is Integer'Image such a conversion? What about arbitrary casts between
> numeric types? What about unchecked casts?
I was expecting someone to come up with Unchecked_Conversion, so you win :-)

Do not confuse "weakly type" and "strongly type with a mean to disable
it in a controlled way when absolutely necessary". Having no safety
belts in a car is not the same thing as having belts and not putting
them (as far as the car design is concerned).

What I find amusing (or characteristic of the C/C++ spirit) is the idea
that "if you are careful, it is good enough".

I generally conclude my presentations of Ada with two quotes. The first
one is from K&R, in one of the first books about C:

"C has been designed under the hypothesis that the programmes is
reasonable and knows what he's doing"

The other one from ARM's introduction:
"Concern for the human programmer was also stressed during the design"

C is not for humans...
--
---------------------------------------------------------
J-P. Rosen (rosen(a)adalog.fr)
Visit Adalog's web site at http://www.adalog.fr
From: Dmitry A. Kazakov on
On Thu, 15 Apr 2010 14:31:48 -0700 (PDT), Maciej Sobczak wrote:

> In particular, what are "conversions between logically unrelated
> types"?
> Is Integer'Image such a conversion?

Yes, if you include String into the algebra of the Integer type, no
otherwise. No different to:

function ">" (Left, Right : Integer) return Boolean;

What does Boolean here? Is it a type logically unrelated to Integer?

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
From: Dmitry A. Kazakov on
On Fri, 16 Apr 2010 09:28:06 +0200, J-P. Rosen wrote:

> Do not confuse "weakly type" and "strongly type with a mean to disable
> it in a controlled way when absolutely necessary". Having no safety
> belts in a car is not the same thing as having belts and not putting
> them (as far as the car design is concerned).

I like this analogy. C++ has safety belts coiled under the spare tyre in
the luggage boot.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de