6 ms·
I do understand your point, but purity is one of the defining characteristics of Haskell, and one of the features that differentiates it from most other languag
by dfeltey 13y ago
I do understand your point, but purity is one of the defining characteristics of Haskell, and one of the features that differentiates it from most other languages, so I think it should be mentioned up front when introducing Haskell.
- davidw 13y agoMention it, maybe, but pointing out how great it is not to have to deal with that messy "real world" is bad marketing. It makes you think "oh, so all these benefits only exist in the magical fairy land and not in the real world where I work?"
- seanmcdirmid 13y agoI think it is great "truth in marketing", because going beyond purity requires talking about things like monads, and then they've lost most of their audience anyways. It is better to lose those not interested in purity early rather than have those uninterested folks become disappointed later.
- mercurial 13y agoI understand what you're saying. It would be better to just talk about the enforced separation between pure code and code with side-effects, and explain that it's possible to structure a normal program so that it's mostly pure.
- seanmcdirmid 13y agoYou are just making a claim though, no one know if it is actually true. Semantic purity doesn't necessarily lead to human clarity, which is one of the mountains Haskell has had to climb: it doesn't seem "easier" or "more simple" than other approaches, only claims of safety might hold up to some scrutiny.
- tome 13y agoAs a day-to-day Haskell programmer I'm happy to say that purity makes it easier to understand the programs that I write. Still, you're welcome to suggest that's an entirely subjective anecdote if you like.
- seanmcdirmid 13y agoYou'd think that an empirical experiment with new programmers could prove the point, or at least provide conclusive evidence.
- tome 13y agoPersonally I wouldn't think that. I think that such things are far too complicated to be amenable to scientific study.
- seanmcdirmid 13y agoI would normally agree, but specific usability claims are being made continuously about the benefits of purity, while many programmers think of Haskell has being anything but.
- mercurial 13y agoYou will note that I make no claims about clarity, only that it is possible to separate pure from impure code in Haskell (which is certainly true). The problem with Haskell and clarity are, in my experience, twofold: - large amount of high-level concepts to absorb (though not everything is necessary to start producing code) - the power of the language is its own worst enemy at times - it is possible to write a pipeline of complex computation with very little work, which leads to less code but less readability (on the other hand, Haskell functions are typically short, which helps a lot with maintaining up-to-date comments) On the other hand, the separation between pure and impure code is not a complex notion per se, and reasoning about pure code is made much easier.
- 13y ago
- tome 13y agoIt doesn't say you don't have to deal with 'that messy "real world"'! It is called Real World Haskell after all.