comp.lang.ada
 help / color / mirror / Atom feed
From: cosc19z5@Bayou.UH.EDU (Spasmo)
Subject: Re: strongly typed langauge
Date: 1996/09/21
Date: 1996-09-21T00:00:00+00:00	[thread overview]
Message-ID: <52034c$fd0@Masala.CC.UH.EDU> (raw)


AGBOH CHARLES (cagboh@vub.ac.be) wrote:
: Hi


: Could Some explain to me what the term "strongly typed language" is in the
: context of ada.  Could you give some examples and tips as on how to
: avoid errors related to this particular domain.

Well strongly typed language in general means that strict type
checking is in place.  For instance try to mix and match various
numeric types in Ada and you'll quickly know what this means.
C will let you do stuff like mix floats and integers, but Ada
won't, at least not without explicit conversion.  Also you can
create new types which will be incompatible with old types,
even if they are "the same".  For instance compare the
following with C (notorious for being such a weakly typed language):

Ada:

type MY_INTEGER is new INTEGER;

C:

typedef int MY_INTEGER;

Now Ada will prevent you from mixing types of MY_INTEGER with
types of INTEGER, while C will happily let you mix MY_INTEGER
with int.  What this means for you as a developer is that
you get an extra layer of protection, and what IMO maps to
an ability to better reinforce your data types and map your
program to the problem domain you are wishing to solve.  Of
course if you are in the habit of mixing types, you will get
numerous errors, but these are easy to correct, and IMO will
save you grief in the long run.  Better a compile error now
than a runtime error a week later.

: thanks

--
Spasmo
"John Wayne was a Nazi, he liked to play SS
 He had a picture of Adolph the Boy tucked in his cowboy vest"
	"John Wayne was a Nazi" by MDC





             reply	other threads:[~1996-09-21  0:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-09-21  0:00 Spasmo [this message]
  -- strict thread matches above, loose matches on Subject: below --
1996-09-24  0:00 strongly typed langauge Spasmo
1996-09-19  0:00 AGBOH CHARLES
1996-09-19  0:00 ` Larry Kilgallen
1996-09-19  0:00 ` Ian Ward
1996-09-22  0:00   ` Hugh Bonney
1996-09-22  0:00   ` Hugh Bonney
1996-09-23  0:00     ` Alan Brain
1996-09-20  0:00 ` Alan Brain
1996-09-23  0:00   ` Robin Vowels
replies disabled

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