From: J-P. Rosen on 15 Apr 2010 04:59 While preparing the upcomming "Using Object Oriented Technologies in Secure Systems" tutorial for Ada-Europe (plug, plug...), I came across this beautiful statement (OOTiA, B.1.1.6): "C++ is a strongly typed language, if conversions between logically unrelated types are avoided". Ain't that cute? -- --------------------------------------------------------- J-P. Rosen (rosen(a)adalog.fr) Visit Adalog's web site at http://www.adalog.fr
From: Martin Krischik on 15 Apr 2010 05:19 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 -- Martin Krischik
From: Dmitry A. Kazakov on 15 Apr 2010 05:59 On Thu, 15 Apr 2010 10:59:37 +0200, J-P. Rosen wrote: > While preparing the upcomming "Using Object Oriented Technologies in > Secure Systems" tutorial for Ada-Europe (plug, plug...), I came across > this beautiful statement (OOTiA, B.1.1.6): > > "C++ is a strongly typed language, if conversions between logically > unrelated types are avoided". > > Ain't that cute? Well, strong typing is unrelated to type conversions, so the sentence above is nonsense. Actually, *logically* (meaning semantically) unrelated types can be mixed without any conversions: int ArrayIndex; int EmployeeID; Employee_ID = Arraj_Index: The question is whether a strongly typed language is designed in order to support and encourage mapping logically unrelated entities onto physically unrelated types or not. Ada more or less is, C++ more or less is not. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de
From: Georg Bauhaus on 15 Apr 2010 06:49 J-P. Rosen schrieb: > While preparing the upcomming "Using Object Oriented Technologies in > Secure Systems" tutorial for Ada-Europe (plug, plug...), I came across > this beautiful statement (OOTiA, B.1.1.6): > > "C++ is a strongly typed language, if conversions between logically > unrelated types are avoided". > > Ain't that cute? The argument is brilliant, I think. (At least outside its specific context, which is the weak types of C still underlying C++, where weak refers to the definitions of the cited document.) I'm serious. "if you avoid doing stupid things" brings the sane programmer into focus who wouldn't actually convert between logically unrelated types, anyway. You want sane programmers. Add this argument to your marketing speech repertoir. If a type system is needed to avoid stupid conversions, then what does this tell us about Ada programmers, huh?
From: Maciej Sobczak on 15 Apr 2010 17:31 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." Indeed, if I cherry-pick bits of this page on Wikipedia, C++ seems to be strongly typed. If I cherry-pick some other bits, Ada seems to be weakly typed. 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? -- Maciej Sobczak * http://www.inspirel.com YAMI4 - Messaging Solution for Distributed Systems http://www.inspirel.com/yami4
|
Next
|
Last
Pages: 1 2 3 4 5 6 Prev: AdaControl 1.12r3 released Next: ANN: Interval Arithmetic for Ada v1.8 |