Related articles |
---|
Seeking brief description of the benefits of Type Inference david.witten@template.com (1997-05-12) |
Re: Seeking brief description of the benefits of Type Inference salomon@nickel.cs.umanitoba.ca (1997-05-13) |
Re: Seeking brief description of the benefits of Type Inference djw@cis.ksu.edu (Derek J. Witt) (1997-06-13) |
From: | "Derek J. Witt" <djw@cis.ksu.edu> |
Newsgroups: | comp.compilers |
Date: | 13 Jun 1997 22:07:38 -0400 |
Organization: | Kansas State University - Computing and Information Sciences |
References: | 97-05-144 |
Keywords: | types, ML |
David Witten wrote:
> I don't know ML (or any other language that has type inference), and so
> don't know why type inference is good. Other than obviating the need
> to declare the type of constructs what are the benefits of it to the
> work-a-day programmer/maintainer?
Well, ML is a strongly typed language. While being a hard language
for beginners to understand, declaring functions are easy to do. You
don't have to worry about types. Type inference in ML is like
this. The first time a variable in a function is used, the type of
that variable is detected by the manner it is used. That also makes
it easier in some ways when first writing the programs, and sometimes
when maintaining the programs. On the other hand, type errors are
more common if too many variables are used in the same functions (or
in multiple functions).
By the way, BASIC also has type inference.
--
*************************************************************************
* Derek Witt * senior, computer science *
* 1524 Humboldt St BSMT * Kansas State University *
* Manhattan, KS 66502-4128 * - djw@cis.ksu.edu - *
* USA * Home Phone: +011 (913) 537-4708 *
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.