sylvan at student.chalmers.se
Sun Feb 15 00:37:12 EST 2009
2009/2/14 Peter Verswyvelen <bugfact at gmail.com>
> One of the things I liked a lot when working with C# was that as soon as my
> code compiled, it usually worked after an iteration of two.At least if we
> forget about the nasty imperative debugging that is needed after a while
> because of unanticipated and unchecked runtime side effects.
> After heaving read about Haskell and having written some small programs for
> the last year or so, I'm now finally writing a bigger program with it. It is
> not so easy yet since learning a language and trying to reach a deadline at
> the same time is hard :)
> However, it is just amazing that whenever my Haskell program compiles
> (which to be fair can take a while for an average Haskeller like me ;-), it
> just... works! I have heard rumors that this was the case, but I can really
> confirm it.
> A bit hurray for strong typing! (and if you don't like it, you can still
> use Dynamic and Typeable ;-)
I've found the same thing. An interesting observation is that (for me) the
vast majority of the type errors are things that would've happened in *any*
statically typed language (like C#), but somehow Haskell manages to be a lot
better at catching errors at compile time.
So my conclusion is that it's not just static typing, it's functional
programming in conjunction with static strong type checking.
When all you're writing are expressions, then *everything* goes through some
level of "sanity checking". When you're writing imperative code, a lot of
the meaning of your program comes from the ordering of statements - which
usually isn't checked at all (aside from scope).
So IMO static typing is good, but it's only with functional programming that
it really shines.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe