Re:Testable IO in Haskell
by pron on Sunday June 21, 2015 @02:01PM
(#9754314)
Yes, I agree that it's better to write good code than bad code :)
Clear separation of concerns is an important aspect of good code, and every language teaches this practice. I don't think Haskell has any advantage there.
I also think -- and this is probably a point of contention -- that the way Haskell separates pure computation from side-effects is a bit arbitrary. Haskell defines computation in a way similar to lambda calculus, which designates as impure any change to something which may then affect a function's result not through its arguments. In short, it equates the mathematical notion of the function with the software notion of the subroutine. Haskell subroutines are mathematical functions, period (well, except for unsafe etc.). I don't think that this is the best way to describe code, or to define separation of concerns (It also makes Haskell jump through hoops when it deals with things that are natural for computation but don't fit well with the notion of a mathematical function). A good separation of concerns in Haskell is not necessarily the best organization for Java/Python.
Re:Testable IO in Haskell
by pron on Monday June 22, 2015 @06:56AM
(#9757427)
I don't know, other than good supervision by an experienced developer :) This one, though, isn't that good, IMO. Perhaps future effect systems will show us the way.
Clear separation of concerns is an important aspect of good code, and every language teaches this practice. I don't think Haskell has any advantage there.
I also think -- and this is probably a point of contention -- that the way Haskell separates pure computation from side-effects is a bit arbitrary. Haskell defines computation in a way similar to lambda calculus, which designates as impure any change to something which may then affect a function's result not through its arguments. In short, it equates the mathematical notion of the function with the software notion of the subroutine. Haskell subroutines are mathematical functions, period (well, except for unsafe etc.). I don't think that this is the best way to describe code, or to define separation of concerns (It also makes Haskell jump through hoops when it deals with things that are natural for computation but don't fit well with the notion of a mathematical function). A good separation of concerns in Haskell is not necessarily the best organization for Java/Python.