On Wed, 17 Feb 1999, michael abbott wrote:

> As a C++ user (with a background in categories) patiently waiting for
> something a lot better, I personally favour two principles:
> 1.    let's go for undecidable type checking.  I want the compiler to be able
> to do as much work as possible: ideally, everything that can be resolved at
> compile time should be if only we can express this correctly.
> 2.    in the face of the above, we need to give the compiler more guidance.
> Personally, I favour type declarations everywhere: all identifiers should be
> introduced as being of a particular specified type.

My personal ideals for a programming language are:

(1) The compiler catches as many language inconsistencies as possible
rather than resolving them in possibly incorrect ways. 

(2) A program should be as easily readible as reasonably possible,
which strongly suggests as free for `noise' as possible.

(For example, try doing simple things with the pair STL class and see how
soon relatively simple expressions become incredibly opaque because of the
sheer length of the identifiers make_pair, .first, .second and the fact
that, to maintain portability to compilers with slightly older versions of
the type-conversion algorithm, you have to write things with casts that
express the desired type

pair<float,float> f=g+make_pair(float(5.0),float(3.0))

and not just

pair<float,float> f=g+make_pair(5.0,3.0)

In practice of course the first problem can be macro'd away.)

Hopefully the above digression supports my case that being explicit
everywhere just to close gaps that can be automatically closed by simple
(and easily human comprehensible) algorithms can make programs much harder
to read, and hence harder to understand and detect algorithmic errors.

I'd prefer only to have to put in type decls for identifiers only when the
compiler genuinely can't use a simple algorithm to deduce the unique
interpretation that fits,PROVIDING THIS ALGORITHM IS SUFFICIENTLY SIMPLE
THAT YOU CAN APPLY IT IN YOUR HEAD. If not then I suppose being explicit
everywhere does become a better way to go.

___cheers,_dave______________________________________________________
email: [EMAIL PROTECTED]       "All shall be well, and all shall be
www.cs.bris.ac.uk/~tweed/pi.htm   well, and all manner of things
work tel: (0117) 954-5253         shall be well." 


Reply via email to