4 ms·
> I strongly dislike Haskell's focus on theory. First of all, I completely understand where you're coming from. But the fact that Haskell embraces computer sc
by ebingdom 5y ago
> I strongly dislike Haskell's focus on theory.
First of all, I completely understand where you're coming from.
But the fact that Haskell embraces computer science, unlike most other programming language communities, is what attracts me to it the most. I can geek out about the mathematics that leads to simpler, safer software with like-minded people. I am always learning from Haskellers more than from any other programmers.
But it does take a lot of learning and unlearning to become a fluent functional programmer. This isn't because functional programming is more complicated than other paradigms (au contraire), it's because schools and universities have been mostly teaching OOP for the past 2-3 decades—unfortunately. As a result, most programmers have such a big gap in their knowledge that it can feel too daunting to dive in.
We could definitely do a better job teaching the theory and explaining how it's useful. That would be better for everyone: better for curious minds who want to expand their programming skills, and better for me because I'd have more company to discuss it with.
- tsimionescu 5y agoHaskell embraces PLL. Computer science is much larger than PLL, and much of it ignores PLL entirely. In particular, most algorithms research and papers are expressed in imperative pseudo-code, as that is, in fact, much easier for humans to intuitively reason about than complex category theoretical concepts.
- ebingdom 5y ago> much easier for humans to intuitively reason about than complex category theoretical concepts. We're not talking about any complex category theoretical concepts here. Functors, for example, are one of the first ideas one would learn in a category theory course. Likely even in the first lecture. Even the most advanced functional programs use only the most basic categorical constructs. And when you say "imperative pseudo-code", you've already conjured an implicit monad involving state, I/O, etc. Functional programming just teaches us that it's not the only one—and there are simpler ones that may be more appropriate for the given situation.
- tsimionescu 5y ago> And when you say "imperative pseudo-code", you've already conjured an implicit monad involving state, I/O, etc. Functional programming just teaches us that it's not the only one—and there are simpler ones that may be more appropriate for the given situation. No, I have not. The fact that you can recreate state and I/O using monads does not mean that anyone using state is implictitly using a monad - monads have very specific properties that imperative code often doesn't have. It's only Haskell's laziness that makes it require monads for i/o, by the way. Other pure functional languages don't use them. For example, in Idris, IO and state are not monads, they are effects - tracked at the type system level, but without all of the commodity of monads. For example, you can have a single do-block in Idris that does IO and state operations without needing any monad transformers or lifting.
- 4ad 5y agoLazyness requires monads for IO, but monads are useful for much more than IO, even in eager languages.
- tsimionescu 5y agoAbsolutely, I meant "don't use them for IO", didn't mean to imply they are not used at all in other pure, strongly typed functional languages. I still think they don't often come up in algorithms research, though.
- ebingdom 5y ago> I still think they don't often come up in algorithms research, though. Why are you so fixated on algorithms research in your attempts to dismiss the usefulness of functors and monads?
- tsimionescu 5y agoYou completely missed my purpose. The OP was claiming that Haskell is superior to some other programming languages because it "embraces computer science". I was pointing out that computer science is larger than PLL, and that much of computer science (algorithms research being a very productive field within CS) is not in fact using FP or PLL concepts to a large extent. Basically, I am only trying to dismiss the idea that Haskell is somehow closer to CS or more scientifically correct than other programming languages; instead, it is as related to CS as other languages are, just choosing to focus on a different area than many others. I also want to dismiss the idea that CS == FP, that imperative style reasoning is just some second-tier style not used in rigorous circles - much of the forefront of CS is indeed using imperative style constructs more than FP ones.
- samhh 5y agoHow can you say it's easier for humans to reason about when your test subjects almost all exclusively got started in programming with imperative programming? It's a slightly biased data set.
- WastingMyTime89 5y ago> But it does take a lot of learning and unlearning to become a fluent functional programmer. Just no. The reason Haskell is so complicated to become fluent in has nothing to do with the inherent complexity of functional programming. The Haskell community is just in love with complexe abstraction for the sake of abstraction, extremely terse and hard to understand syntax (see for example the obsession with introducing convoluted operators) and generally favour hard to understand style like point free where pipes are a lot easier to follow. The Haskell community is full of people who are here to geek out rather than produce software. Haskell is what happen when you let one upmanship leads your language design. Meanwhile, you can learn SML, F# and Ocaml in a couple days, gradually enjoy the functionality they have to offer and benefit for a nice community. I really don't understand why anyone would choose Haskell.
- inimino 5y agoIf you don't understand why anyone would choose something that many people have chosen, you might want to be a little less bold in announcing what motivation those people must all have.
- WastingMyTime89 5y agoOh but I know why they choose it. They want to geek out and feel smart. Haskell is somewhat unique regarding modern programming language in that it was created as a research project on programming language. Most other languages emerge as a solution to an engineering problem: C for Unix, Rust for Servo, Ocaml for Coq. If you allow me an analogy, a good programming language and its community starts wanting to build a great building and thinking their scaffolding technoly is inadequate. They then build better scaffolding as they are buildinh their building. Haskell started thinking they had a really cool way to build a scaffold and the community is still more interested in building scaffolding than actually using them. That's why there are more lense libraries than useful software built using Haskell.
- ebingdom 5y ago> They want to geek out and feel smart. Jesus Christ, I am so sick of you and all the people like you who repeat this lie. I've invested a lot of time learning about category theory, domain theory, type theory, etc. so I could become the best version of myself as a programmer, and I have seen very real benefit from this investment. Only to have you and these other people in HN tell me I'm just trying to "feel smart". Your arrogance is so off-putting to me. When did HN become so anti-intellectual? If you don't understand something, then either learn it or don't—but you don't need to bash other people for their own efforts.