comp.lang.ada
 help / color / mirror / Atom feed
From: Tucker Taft <stt@averstar.com>
Subject: Re: Dummy
Date: 2000/02/03
Date: 2000-02-03T19:47:18+00:00	[thread overview]
Message-ID: <3899DB45.B481F8E2@averstar.com> (raw)
In-Reply-To: t7d7qe2xab.fsf@calumny.jyacc.com

Hyman Rosen wrote:
> 
> Charles Hixson <charleshixsn@earthlink.net> writes:
> > Java is more Object Oriented than Ada is, but less type safe.
> > (Those casts are a really bad idea that is carried forwards from C.)
> 
> Java casts are always perfectly safe. Casts between object types are
> akin to C++'s dynamic_cast<T>, in that they are type-checked at runtime
> and will fail if the cast is not valid.

Java and Ada are approximately equal in "safety" when it comes to 
"object-oriented" types.  (Ada allows the distinction between "specific"
and "class-wide" which Java does not support, and the corresponding
option of static versus dynamic binding of calls on primitive operations.
This might be considered more "type safe" in some people's view.
Finally, Ada has local/stack-resident composite objects; all composite
objects in Java are allocated out of the heap -- there is no compile-time
way to ensure their lifetime is limited to a single function invocation.)  

Ada has much more type safety than Java when looking at numeric or
enumeration types.  Ada's arrays are also more strongly typed,
because only the declared index type may be used for indexing,
whereas in Java, any integral type may index any array.

Ada also allows compile-time distinctions between access (reference) 
types, each with potentially its own heap.  In Java, all objects
are dynamically allocated out of a single garbage-collected heap.

-- 
-Tucker Taft   stt@averstar.com   http://www.averstar.com/~stt/
Technical Director, Distributed IT Solutions  (www.averstar.com/tools)
AverStar (formerly Intermetrics, Inc.)   Burlington, MA  USA




  parent reply	other threads:[~2000-02-03  0:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-02  0:00 Dummy Simic_10111
     [not found] ` <3898C380.BC01EC03@earthlink.net>
2000-02-03  0:00   ` Dummy Hyman Rosen
2000-02-03  0:00     ` Dummy Gautier
2000-02-03  0:00       ` Dummy Hyman Rosen
2000-02-03  0:00     ` Dummy Larry Kilgallen
2000-02-03  0:00       ` Dummy Hyman Rosen
2000-02-03  0:00         ` Dummy Larry Kilgallen
2000-02-03  0:00     ` Tucker Taft [this message]
2000-02-04  0:00       ` Dummy Florian Weimer
2000-02-04  0:00         ` Dummy Robert A Duff
2000-02-05  0:00           ` Dummy Jean-Pierre Rosen
2000-02-10  0:00             ` Dummy Geoff Bull
2000-02-07  0:00         ` Dummy Hyman Rosen
2000-02-07  0:00           ` Dummy Florian Weimer
2000-02-07  0:00             ` Dummy Hyman Rosen
2000-02-04  0:00       ` Dummy Robert A Duff
     [not found] ` <389c50a6.14707859@news.flash.net>
2000-02-04  0:00   ` Dummy Marin D. Condic
  -- strict thread matches above, loose matches on Subject: below --
2000-01-11  0:00 Dummy Simic_10111
2000-01-11  0:00 ` Dummy Gautier
2000-01-11  0:00 ` Dummy Ehud Lamm
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox