5 ms·
They are similar in that they are both kind of big languages with many features, and a reputation for difficulty. However, Haskell's reputation is one for diff
by philzook 7y ago
They are similar in that they are both kind of big languages with many features, and a reputation for difficulty. However, Haskell's reputation is one for difficulty on how to do anything at all but once you do the angels sing, while in C++ it is difficult to do anything right.
I think the positive lists diverge significantly, and I don't really think of the languages as being similar at all.
- HelloNurse 7y agoI didn't mean that C++ and Haskell are particularly similar, but that if the feature set of C++ is "huge" the even more arcane Haskell language extensions are in the same league, that legacy features that shouldn't be used in C++ are no worse than multiple half-baked incompatible libraries for the same basic purpose in Haskell, that if C++ is full of footguns Haskell is full of footgun categories, that if C++ syntax is verbose Haskell syntax is bizarre and misleading. Evidently, being in love with a programming language is an obstacle to comparing it honestly.
- philzook 7y agoIt is very, very, very difficult to be in love with a language and compare it honestly. I don't think I've ever seen anyone successfully do so. I don't agree that Haskell has as many footguns or as much legacy cruft, but if you've found that to be the case, I value your opinion.
- tome 7y ago> I don't agree that Haskell has as many footguns or as much legacy cruft, but if you've found that to be the case, I value your opinion. And moreover, please write a blog post or even short comment about it, because few Haskell footguns are obvious to me and I would appreciate the warning!
- philzook 7y agoA short list off the top of my head: It is very easy to get over eager and use more abstraction than you need or can handle. This is perhaps the worst of them. Strings shouldn't be [Char]. OverloadedStrings should be the default. There are partial functions in base. head for example It is easy to spring space leaks due to laziness. Relatedly, choosing between foldr foldl foldl' Incomplete pattern matching (which will be a warning) or sometimes default _ casing. If you add to the type, the compiler won't save you. It is not necessarily so obvious to a beginner when you are doing tail call recursion. Maybe overuse of typeclasses when records work better? Over use of Template Haskell can raise an eyebrow. A minority of extensions are ill advised. All in all, I think the level of footguns in Haskell is in a different universe than C++, but I am trying to see it from the other perspective. http://dev.stephendiehl.com/hask/#what-to-avoid http://dev.stephendiehl.com/hask/#what-to-avoid http://dev.stephendiehl.com/hask/#the-dangerous http://dev.stephendiehl.com/hask/#the-dangerous
- tome 7y agoThanks and agreed! However, I was more asking for HelloNurse's opinion, since I can't think of any Python footguns that are on the same level as C++'s. The ones you cite are more on the level of Python's.
- HelloNurse 7y agoA nice article from slightly over 1 year ago https://lexi-lambda.github.io/blog/2018/02/10/an-opinionated-guide-to-haskell-in-2018/ https://lexi-lambda.github.io/blog/2018/02/10/an-opinionated... was linked on HN today. It explains organized footgun management, with a discussion of what language extension should and should not be enabled, and some specific library threats (e.g. String and ByteString).
- philzook 7y agoThat is an excellent article. String vs ByteString is a beginner footgun in Haskell. It won't make incorrect or crashing code, but it will show up as poor performance on text heavy processing.