Re:Choosing a Programming Language
by polymatter on Friday April 05, 2013 @04:38AM
(#5497318)
In fairness, Haskell makes it more awkward to deal in mutable state and arbitrary IO. Like how not using goto in a more mainstream language makes it more awkward to have arbitrary control flow. Debugging is annoying when I can't stick a println or puts in any arbitrary function. (The solution of course is to have small functions and print them. If your Haskell function is over 20 lines long you're probably doing it wrong.)
Of course, Haskell also means if your program compiles, 90% of the time it runs fine. I love that about it. (Unit tests are still required for the things the compiler can't catch, but its a major win regardless)
> Debugging is annoying when I can't stick a println
You might not know about Debug.Trace? http://www.haskell.org/ghc/docs/latest/html/libraries/base/D...
Re:Choosing a Programming Language
by polymatter on Friday April 05, 2013 @07:33PM
(#5501706)
Thanks very much! Thats just what I wanted :)
No. Haskell requires that you declare where IO is allowed (via the type). Once you assert that you admit mutable state (ST) or arbtirary IO (IO), then you are free to use them.