QuantumG wrote:

> Erik de Castro Lopo wrote:
> 
> >Thats why I'm so keen on O'Caml. It offers even more static analysis
> >than C and C++. Its significantly more difficult to write bugs into
> >an O'Caml program than a C or C++ program.
> 
> Sounds like the antithesis of Objective-C and other dynamically typed 
> languages.

Yep, thats right.

The problem with dynamic typing is that it postones testing for an
important class of errors (type errors) until run time. The main
way of avoiding type errors in dynamically typed languages is by
using a test suite (or face the possibility of sending a program 
with unchecked type errors to your customers). Even if you have a 
test suite, how sure are you that it will catch all errors? How
much effort are you putting into the development of the test 
suite?

Contrast the above with O'Caml (or Haskell) where you cannot create
an executable with type errors [0]. You still need a test suite for
programs written in O'caml, but the set of possible problems to
test for is much smaller and hence requires less effort [1].

Erik

[0] : Well you can, by using the O'caml Marshall module (which most
      O'Caml programmers don't use very often if at all) or by 
      linking O'caml to C code.

[1] : Yes, I'm lazy.



> 
> Fun.
> 
> Trent
> -- 
> SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
> Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
> 


-- 
+-----------------------------------------------------------+
  Erik de Castro Lopo
+-----------------------------------------------------------+
"The object-oriented model makes it easy to build up programs by
accretion. What this often means, in practice, is that it provides
a structured way to write spaghetti code." -- Paul Graham
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to