3 ms·
> - No, we were talking about safety, not convenience. If you don't want to compare programs written for the same effort, then what? Should we compare Haskell
by infraruby 12y ago
> - No, we were talking about safety, not convenience.
If you don't want to compare programs written for the same effort, then what? Should we compare Haskell programs written with more effort to bash programs written with less effort? That's a confounding variable!
For the programmer there is always an opportunity cost: an hour spent satisfying a type-checker is an hour that could have been spent testing. Which use of that hour would provide the greatest safety? That is an empirical question.
> Stop shifting the subject.
No, you keep shifting the subject when you claim that Haskell programs are safer in practice but you then run away to your wonderland, where time stands still and the problem of opportunity cost has been solved, where you "prove" whatever you like while detached from reality, and then return to pretend that your "proofs" are valid in practice!
> - No, this is not a case of No True Scotsman.
So... if Angus writes fromMaybe "", which is accepted by the Haskell compiler but deletes all my files, is he a Haskell programmer?
> - No, a programming language with additional safeties is logically safer than one without, all else being equal (i.e. if no other safeties get removed instead).
Oh, "logically"! It's amazing what you can "prove" when you postulate a magical language that stops the clock while you satisfy the type-checker! Unfortunately, on this planet, time waits for no man, and you must choose how you spend it. Which approach provides the greatest safety, for the same effort? That is an empirical question, and you still have no empirical evidence for your position.
> - No, Haskell programmers aren't smug fools who believe that because their programs compile then they must be correct, and therefore no additional testing or QA is necessary.
No, you just believe you don't need empirical evidence for empirical claims! :-/
> A type-checker enforcing some constraints automatically makes your language practically safer than one without it.
Perhaps. But perhaps the time spent satisfying a type-checker would be better spent testing. Perhaps bash is safer than Haskell in practice!
- codygman 12y ago> perhaps the time spent satisfying a type-checker would be better spent testing One of the reasons I like languages with more advanced types systems such as Haskell's or Scala's is because test suites in other languages to achieve the same code coverage take much longer to run.
- infraruby 12y ago> One of the reasons I like languages with more advanced types systems such as Haskell's or Scala's is because test suites in other languages to achieve the same code coverage take much longer to run. Do you mean Haskell has better runtime performance than dynamic languages, test for test, or that programs in dynamic languages need more tests (say, tests of function return types), or both? In practice programs are written by programmers, not generated randomly, so it is not necessary to test "all the things that can go wrong" but only the things that programmers actually do wrong in practice.
- frowaway001 12y agoWith your reasoning bugs would have just stopped existing altogether decades ago. Obviously they haven't.
- infraruby 12y agoSuppose a function f(a, b) should return the sum of its arguments (i.e. a + b). What tests would you write for this function?
- the_af 12y agoSo you refused to answer my direct question: how fluent are you with Haskell? I must assume the answer is "not much", which is why you keep building strawmen and disregarding everything people tell you about the language. For an empirical advocate, you keep arguing from a quite theoretical point of view. Good luck with that!
- infraruby 12y ago> So you refused to answer my direct question: how fluent are you with Haskell? http://www.paulgraham.com/disagree.html http://www.paulgraham.com/disagree.html DH0 DH1 <-- you are here DH2 DH3 DH4 DH5 DH6 > For an empirical advocate, you keep arguing from a quite theoretical point of view. What you assert without evidence can be dismissed without evidence.
- the_af 12y agoSooo... how fluent are you with Haskell?
- the_af 12y ago> So... if Angus writes fromMaybe "", which is accepted by the Haskell compiler but deletes all my files, is he a Haskell programmer? He is a Haskell programmer, the same as any Haskell programmer that runs launchAllNukes. What he is not is a surprised Haskell programmer, unlike someone, say, a programmer using bash or a programming language which allows nulls and/or accessing undefined variables with surprising results. Why is Angus not surprised? Well, because he chose to return "" when he had Nothing. Presumably he thought the empty string was an acceptable value, and he wasn't trying to indicate "no value", because that is what Haskell programmers use Maybe for (and please don't mention Scotsmen here, because it will only make you seem ignorant). If his choice turned out to cause a bug, he made a mistake. But note this is unlike the situation for Mr Bash, who didn't choose to access an undefined variable, and unlike Mr Java Dev, who didn't choose to ignore a possible null return value. This is because Haskell is safer than bash or Java: Angus, Mr Bash and Mr Java can all make mistakes when choosing default values, but unlike the other two, Angus cannot make the mistake of accessing an uninitialized variable or a null reference. He is lucky like that!