On Tuesday 10 March 2009 13:26:32 Vincent Foley wrote:
> Here's my feeling on it (note that I am talking about languages from
> the C family, not Haskell or ML). 

Then the feelings you are describing are specifically about C and are not 
related to static typing in general.

> 1. Like Jason Wolfe said, the interactive REPL means that you can
> manually test a function as soon as you're done writing it, so it's
> easy to get feedback and know if something breaks.

Even C# has a REPL now.

> 2. The whole thing does not need to be complete or even functional for
> you to start unit testing.

Apples and oranges: unit tests are not the same between dynamic and static 
code bases because dynamic code bases rely upon a huge number of additional 
unit tests to serve as a poor man's substitute for static type checking.

> 3. The type systems of Java, C and C++ do not protect you against
> errors like NullPointerExceptions. (I am pretty sure C# has nullable
> types now, and of course Haskell has Maybe t.)

Actually Haskell's Maybe monad is a counter example because its sole purpose 
is to protect you from the equivalent of null pointer exceptions by forcing 
you to be explicit about them.

> 4. Not having the static type system means that if it's ever needed,
> it will be possible for you to do what you know is right instead of
> what the compiler wants.

You are assuming that what you know is right and what the compiler wants are 
different. IME, that is virtually unheard of in real code.

Most of the reasons given in this thread were red herrings and many of static 
typing's real issues were not even touched upon:

. Implementing modern static type systems correctly is really hard. 
Consequently, the vast majority of new languages are dynamically typed 
because that is much easier to implement.

. Interface code between dissimilar parts of a program is often incapable of 
conveying static type information so static type checking is useless here. 
This includes everything from remote procedure calls through to database 
transactions and down to the foreign function interface. Haskell's Darcs 
project was almost killed by an FFI-related bug.

. Static typing is hard to appreciate and hard to learn. People with no 
experience of developing complex software correctly cannot appreciate the 
benefit of proving any kind of correctness because everything they have done 
is obvious. Concepts like parametric polymorphism are just mathematics so a 
math background helps.

-- 
Dr Jon Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?e

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---


Reply via email to