4 ms·
>Not only do you get to use it's wonderful type system but you can compose together small imperative programs into bigger, more useful ones. These bigger, more
by fooker 8y ago
>Not only do you get to use it's wonderful type system but you can compose together small imperative programs into bigger, more useful ones.
These bigger, more useful programs you can write with Haskell are pretty much unreadable though. There is a reason everyone is not jumping into the functional programming bandwagon, despite mature languages being available for 30+ years.
- jaggederest 8y agoI wrote a fairly reasonable toy raytracer in it and I found it very readable. The hard part was that the type system doesn't help you get your algorithms to spit out the correct answer, only the correct kind of answer. After a while I find that errors of that sort dominate the kind of things the type system helps with. And I'm sure there are type-system-ways-to-solve-that-problem but they're nonobvious and would probably render the rest of the program more confusing. Certainly adding in error handling and state did, compared to working strictly in the IO monad.
- svachalek 8y agoEveryone thinks their own code is readable. It's when you jump into a project with code written by 10 other people that you get an idea for a language's innate readability. In my experience I tend to agree that Haskell does not score high on this dimension, its syntax is too terse and too flexible and there are few conventions about how to organize large codebases.
- jaggederest 8y agoWell, to clarify, I found the code in the libraries etc very readable, obviously I can read my own code :)
- fooker 8y agoA significant number of interesting Haskell libraries I found are thin abstractions over some C api. It makes sense that these would be readable. Is there something for Haskell which serve a similar role as boost to C++? If that is readable, I will be convinced.
- squiggleblaz 8y agoI actually disagree. I write very little Haskell but I do read it from time to time, simply because compared to any other language it's simply so readable it's almost fun. In no other language have I ever got distracted from my main goal by just reading the source code of the libraries I'm using.
- marcosdumay 8y agoWhile programming, I end up reading the source of most badly documented packages on Hackage that have some interface that looks like what I'm doing. Nearly all that mostly low quality (correlates pretty well with lack of documentation) code is perfectly legible (although some have other problems). I have never seen any language get near Haskell on the legibility of random code on the internet.
- skgoa 8y agoI have found that Java enforces a higher floor of readability than most languages, simply because you have to type out so much "boilerplate" for everything. Though even that does not come close to Haskell. Ironically, the introduction of lambdas made bad Java code using them far less readable.
- marcosdumay 8y agoYes. On my eyes Java was always the clear choice for enterprise code, because people come and go, and one bad apple does not destroy the entire code base on Java. After I learned Haskell I had a "I knew nothing!" moment. Anybody writing enterprise code on anything that is not as safe as Haskell (that is, basically everybody) is letting a lot of money on the table.
- thinkpad20 8y ago> These bigger, more useful programs you can write with Haskell are pretty much unreadable though. This seems somewhat baseless. Unreadable according to whom? There are many large and complex programs written in Haskell by large teams of developers (open source or otherwise). It’s the nature of software in any language to become difficult to manage as the code base becomes large; I don’t think Haskell is an exceptional offender in this category. > There is a reason everyone is not jumping into the functional programming bandwagon, despite mature languages being available for 30+ years. There certainly are reasons for that, but not the ones you laid out.
- fooker 8y ago>There are many large and complex programs written in Haskell by large teams of developers (open source or otherwise). How many of those projects regularly attract new contributors, vs ..say.. something written in python or C++?
- Koshkin 8y ago> pretty much unreadable The last readable programming language was Algol 60.