22 ms·
Learning Haskell is no harder than learning any other programming language
- Dude2029 7y agoI would expect to get paid more though and that is not happening (except niche places). Same story with F# and Scala. Not worth it.
- atemerev 7y agoScala software engineers are some of the best paid out there.
- gb 7y agoI don't know whether this is true or not, but either way, working with Haskell makes my job more enjoyable than if I was writing some other language anyway.
- octagonal 7y agoCoincidentally: it’s also the only programming language I know of where someone has written a lengthy blog post about how I’m in fact, not too dumb to comprehend it.
- giancarlostoro 7y agoI didnt think about how hard Haskell is because I never forced myself to learn it. It just didnt interest me. With Java or C# I can make so many things with minimal friction. The other language that people talk about being hard is Rust. I am going to assume theres blog posts about it not being hard. I like that with Go or Erlang everything I learned 5 or more years ago has still stuck to me. With D I can be effective quickly. With Rust I struggle a bit. Rust is probably great for building a web browser but doing backend web development feels way more work than Go or even Python (CherryPy). Haskell I dont even remember a darn thing anymore.
- jimbob45 7y agoNo one has ever been able to explain to me why I should use Haskell instead of something else. I get answers about idempotence and list comprehension and strong typing which are great tactics but I never get the sense that they fit into an overarching strategy for how my life will be made easier by using Haskell. I know Carmack has presented a case to code in a pure functional style here https://www.gamasutra.com/view/news/169296/Indepth_Functional_programming_in_C.php https://www.gamasutra.com/view/news/169296/Indepth_Functiona... but that somewhat precludes the necessity of switching to another language from C++. Further, he advocates for a new keyword 'pure' to assist the compiler like const does, perhaps not knowing that const doesn't actually help the compiler out in practice.
- z3phyr 7y agoShort answer: Because of the features you mentioned, You will be able to write code which is correct, self documenting, and achievable in fewer lines of code[.]. Your life won't be easier if you solve problems, because solving problems is hard. But you get a lot of benefits from using any language which has features similar to Haskell because of the above reasons. If you are into programming language research, compilers, theorem provers etc, Haskell comes with a lot of idioms, features and tools that it is a viable language for the tasks at hand. [.] a lot of languages rightly claim it like lisps and modern lisp derivatives, but Haskell brings with it a top of the line type system, (imo) a clearer syntax and tooling than OCaml, and a decent support from the industry and the academia..
- capableweb 7y ago
- Tempest1981 7y agoMaybe I missed it, but what's the best way to learn basic Haskell? I was expecting a tutorial. Or link to one.
- tome 7y agoThis is the canonical resource, I believe https://github.com/bitemyapp/learnhaskell https://github.com/bitemyapp/learnhaskell
- colluphid 7y agohttp://learnyouahaskell.com/chapters http://learnyouahaskell.com/chapters
- ahartmetz 7y agoNO. Not that one. It explains the easy parts at (boring, pseudo-funny) length and expects you to understand the hard parts after a few sentences.
- noisem4ker 7y agoIt's good at explaining those easy parts, though. It also encourages experimentation in the REPL. For a more complete understanding, I agree that it must be accompanied by some more reference-style material.
- massysett 7y agohttp://haskellbook.com/ http://haskellbook.com/
- nvarsj 7y agoI really like the concise, well explained university course Brent Yorgey put together several years ago [1]. It also works well as a book club at work. https://www.seas.upenn.edu/~cis194/fall16/ https://www.seas.upenn.edu/~cis194/fall16/
- AnthonBerg 7y agoI love this one: https://atypeofprogramming.com/ https://atypeofprogramming.com/
- fooker 7y agoEveryone is smart enough to write Haskell. Almost no one is smart enough to read Haskell. There is a reason loops are easier to read and maintain compared to a fold(map(filter(zip(...)))).
- graphpapa 7y agoI dunno. I like that style, makes more sense to me.
- IceDane 7y agoOkay - so what is that reason?
- deleted 7y ago[deleted]
- tome 7y ago> There is a reason loops are easier to read and maintain compared to a fold(map(filter(zip(...)))). Absolutely not, and I read and maintain loops in both Python and Haskell!
- mjn 7y agoEven in Python I find the vaguely more functional style of list comprehensions easier to read than explicit loops. I've taught enough classes to know that many students who've had only a CS-101 type class do prefer explicit for loops that accumulate a result rather than list comprehensions, though. Seems like any statements about clarity (in either direction) have to include a fairly big caveat about who the audience is.
- fooker 7y agoNice that you mention Python. The creater of Python echoes my points: http://lambda-the-ultimate.org/node/587 http://lambda-the-ultimate.org/node/587
- hobofan 7y agoThat just reads as: "You are already smart enough to write Haskell"... if you accept that you are too dumb for most of Haskell and are therefore okay with being cut off from most of its ecosystem. Digging into a dependency due to a bug or custom feature is something that usually happens on any bigger project of mine. If I have to expect that I won't be able to work in a dependencies codebase because it will most likely contain (multiple) concepts that I won't be able to understand, then that's a big no-no.
- chii 7y agomost people drive cars, and yet have very little understanding of how it actually works internally. As long as the interfaces are well designed, this works fine for most. I say the same is for haskell.
- hobofan 7y agoThat's fine if you use your car for commuting (= casual projects with no special requirements) but not if you want to compete on the race track. Of course you can optimally keep out of the dependencies, and a lot of people don't even think about digging into them and unnecessary limit themselves, but as I said in my initial comment, every bigger project I worked on involved tweaking dependencies in one way or another.
- yakshaving_jgt 7y agoTo run with your analogy — which I don't find particularly constructive anyway — people who are just starting to drive don't start by competing on the race track.
- iterati 7y agoWith no prior experience with lisp, I was able to get comfortable in a clojure-only codebase in less than 3 months.
- 7y ago
- li4ick 7y agoThe biggest lie about Haskell is that it's easy to learn. No it's not, and I do use it at work. Sure, it's not THAT difficult to get a basic understanding until you get to the usual Functor, Applicative, Monad stuff, which you can understand if you imagine them as context bubbles. Once you put something into a side-effect bubble (IO), you cannot take it out, so you're obligated to work inside of that bubble. This analogy should get you far enough. You're now ready to build toy projects. But, even if you finish the Haskell Book(http://haskellbook.com http://haskellbook.com), which is like 1300 pages, you're still going to be unable to contribute to a serious code base. Anyone who says otherwise is lying. Now, you have to understand at least 20 language extensions which you find randomly at the top of files {-# LANGUAGE ExtensionHere #-}. Now you have to understand how to really structure a program as either a stack of monad transformers, or free monads or anything else. Then you get into concurrency and to do that you have to understand how Haskell actually works, what non-strict computation does etc. etc. Otherwise you're going to get some nasty behaviour. You think I'm done? Let's get to Lens. You can use Lens after a relatively short time of reading the docs. But to understand Lens? Very few people actually understand Lens. Don't get me wrong, Haskell has spoiled me, and I don't really want to touch any other language (I still like Clojure, Rust, Python, Erlang). Once you get past that the language is a joy to use.
- yakshaving_jgt 7y agoYou don’t need to understand the internals of a thing to use the thing.
- Quekid5 7y agoThis is exactly right. I use lenses all the time, but I have absolutely no idea how they're actually implemented, nor do I need to know. This is abstraction. If there's one thing Haskell does well it's abstraction. EDIT: It's really bizarre. We see these same responses to all the Haskell-or-Idris-or-whatever threads -- I wonder if there's some imposter syndrome going where "I can't immediately read/write Haskell" somehow morphs into "Haskell is useless". IME it's really rare for people who actually program in Haskell to have serious issues with the language. Yes there are issues from a smaller ecosystem, package management was bad (Stack fixed that), etc. etc. but there are very few fundamental problems with the language. Something so small as just Pattern Matching is a huge increase in productivity. Thankfully, quite a few languages have adopted pattern matching these days (Scala, Rust, TS, maybe even C++23?). (The really big payoff comes from granular effects, but I'm sure the rest of the world will realize in about 20-30 years' time. The Erlang people already have, albeit in a different way.)
- vogre 7y ago...but have no reason to.
- kccqzy 7y agoThere is some utility in carving out a subset of a language to make the remaining part easy to comprehend and easy to contribute to. C++ is a large and complicated language but every team seems to be using a different subset of it. The same thing would happen with Haskell. Every one might have a different idea of where to draw the line for restricting advanced features. The author might decide that Haskell 98 plus OverloadedStrings is good enough. That's a valid stylistic choice. I would have drawn the line further; I personally think features to simulate dependent types aren't worth it (think singletons or DataKinds or TypeInType) but lens is absolutely necessary even though it is difficult for beginners to understand. But ask a colleague of mine, and you might receive a response that we should embrace complicated type-level programming like the kind seen in Servant, but instead restrict TemplateHaskell. All these are valid stylistic choices but they fragment the community. And eventually debugging other people's code bases (say dependencies) you would sooner or later have to face features you don't use. Let us not forget the roots of Haskell as a research language where ideas in functional programming are to be tried out. When it emerged in the 1980s it was literally because a committee wanted a solid foundation to replace a disparate mélange of functional programming languages. It succeeded in that, and immediately introduced new features then considered highly novel (e.g. type classes). In this sense, Haskell will never be as practical and pragmatic as Go, where moderately modern language features aren't even in the language. Choosing a language like Go could be a valid choice, and so is choosing a language like Haskell.
- verttii 7y agoThe real question is is it worth the time & effort.
- amelius 7y agoThe funny thing is that software engineering tools exist to relieve programmers of mental overload. This in turn can be used to build more complicated systems, at the cost of another level of mental overload. So this begs the question: where are the complicated systems written in Haskell that could not have been realized in other languages? Or are Haskell programmers only using the language to sleep better at night?
- tome 7y ago> Or are Haskell programmers only using the language to sleep better at night? For me, the balance point lies definitely closer to the latter. I'm not writing hugely more complicated programs in Haskell than I did in Python but I feel much better knowing they're not likely to fall into pieces next time I touch them.
- verttii 7y agoI guess it ultimately boils down to productivity. I mean that's what high level programming languages are built for to begin with right?
- bob1029 7y agoFrom my perspective, it isn't cut-and-dry. The quick response I give is: If you are developing a business application and no one dies if something goes wrong for a few hours, the answer is "hell no". Productivity takes a hit for no strong upside to the biz. If you are developing a safety-critical system, the answer is "maybe". This one is more obvious. The more complex reasoning is that ultimately, almost every software system has to interface with the outside world in some way. Putting your functional programming layer as your principal interface between your internal and external domains is an extremely high-cost endeavor due to the complexity of handling things you can't predict. If your system is safety-critical, and you have extensive control over the external domain (e.g. dedicated, redundant sensor networks), you might be able to justify this added complexity because you can control many more variables than you would be able to otherwise. An alternative approach that seems ideal to me at this time is to use imperative techniques as the principal architecture, and then use functional within that domain in the specific cases where it can be justified. Good examples of this would be C#/LINQ, or even invocation of F# from C# (e.g. rules engine). Imperative is extremely good at handling side-effects and managing exceptions. Functional is deterministic if you can keep it on rails. Using both where most suitable w/ interop between seems to be the most productive approach. A quick corollary could be: "If you are exclusively using functional techniques to build your application, you are probably making a mistake".
- sitzkrieg 7y agohaskell is easy to learn if you want to ignore a bunch of floofy high level math concepts and just paste how to parse a json library. lets be real, software engineering that brings results is i/o. i see the appeal in pure functions and guarding that out but the shit that matters is going to be the nasty mess of stuff that saves business logic that was hacked together over 10 years of rnd, interns and crunches
- ducaale 7y agoBlog post that explains Functors, Applicatives, And Monads in pictures http://adit.io/posts/2013-04-17-functors,_applicatives,_and_monads_in_pictures.html http://adit.io/posts/2013-04-17-functors,_applicatives,_and_...
- pwm 7y agoHonestly, this blog post is cute but it does not actually give you understanding and insight into these concepts. Imho the only way to internalise these are through practice. Write code, get annoyed by repetition/boilerplate/etc... and discover that abstraction Foo solves that problem.
- modernerd 7y agoThis blog post may help some but readers shouldn't expect it to magically flick a switch that allows them to use or create monads. Instead, I really like: 1. Stephen Diehl's “Eightfold Path to Monad Satori” from “What I Wish I Knew When Learning Haskell”: http://dev.stephendiehl.com/hask/#monads http://dev.stephendiehl.com/hask/#monads “Much ink has been spilled waxing lyrical about the supposed mystique of monads. Instead, I suggest a path to enlightenment: 1. Don't read the monad tutorials. 2. No really, don't read the monad tutorials. 3. Learn about Haskell types. 4. Learn what a typeclass is. 5. Read the Typeclassopedia. 6. Read the monad definitions. 7. Use monads in real code. 8. Don't write monad-analogy tutorials. In other words, the only path to understanding monads is to read the fine source, fire up GHC, and write some code. Analogies and metaphors will not lead to understanding.” 2. Chris/kqr's “The ‘What Are Monads?’ Fallacy?”, which mirrors the advice from Stephen Diehl: https://two-wrongs.com/the-what-are-monads-fallacy https://two-wrongs.com/the-what-are-monads-fallacy “Instead, learn to use specific monads. Learn how Maybe a works, learn how Either e a works. Learn how IO a and [a] and r -> a works. Those are all monads. Learn to use them with the >>= operator and with do notation. Once you've learned how to work with all of those, you'll have a really good idea of how monads can be used. Asking "What is a monad?" to learn how to use monads is as wrong as asking "What is a musical instrument?" to learn how to play musical instruments. It's a good start, but it won't teach you very much.”
- 7y ago
- gassah_qwert 7y agoHaskell is no doubt an interesting language. I have yet to work on a project where it was the obvious choice but I’ve played around with it enough to like it. What I don’t like are some (not all) of the people who use Haskell and talk about it online. They can be incredibly obnoxious. Haskell is not a tool they work with, it’s their entrance to a class of software engineers that you’re not capable of being part of. Just for the record: Anyone can learn Haskell. If you’re struggling with it that’s because of a tooling / literature issue. Haskell people (even the nice ones) are bad at explaining the language. The tooling isn’t very friendly and the language is a shit sandwich to debug. The concepts therein are no more difficult to grasp than any other in programming. Is a Monad a box or a burrito? Please stop. It’s a language feature that allows you to do certain things more concisely than the alternative. Stop pretending it’s magic and show people how to use it and why they should. Stop drawing pictures. No, algebraic data types are not hard to understand. You just make a big deal out of them because you think the word algebraic sounds cool. I could keep going but I think I’ve made my point. Dear Haskell people: Get over yourselves. Do not mistake the larger software community’s disinterest in your pet language for their inability to use it. That’s simply not the case. If people had to use it even ‘lowly js devs’ would master it. Everyone else: If you haven’t used it already it is a very cool language and worth learning even if just for personal edification. Don’t let the self appointed high priests turn you off. Don’t expect their help either.
- tome 7y agoSorry you've experienced this obnoxious behaviour. I've been in the community for years and never seen it. Maybe I'm not hanging out in the same places as you or I have some sort of unconscious bias that means I don't notice it. Could you link me to an example? I have some measure of authority in the community and would like to help decrease the amount of obnoxiousness but I can't unless I know where it happens. > Dear Haskell people: Get over yourselves. Do not mistake the larger software community’s disinterest in your pet language for their inability to use it. That’s simply not the case. If people had to use it even ‘lowly js devs’ would master it. This is really interesting because the Haskell community I hang out with (mostly on Reddit) would love it if "lowly js devs" would master it. In fact we all too often get told by non-Haskellers that "Haskell will never succeed because it's too hard for most programmers to learn"!
- alkonaut 7y agoHaskell was used in the first programming class at university and that was excellent. Some people that already know how to program had to throw their preconceptions out the window. So everyone was either a novice at programming entirely or at least a novice at functional programming. It wasn’t problem at all. I’d argue most students wrote better code in that class than they did in the imperative/OO classes that followed. Especially the students that weren’t (and likely never did become) programmers. The thing about imperative and OO programming is that it’s hard to do well. I honestly havent seen more than 1/10 developers write ”good” OO code even after 10 or 15 years as professionals. Large scale OO is a cognitive load that requires extreme focus, skill and talent. I prefer functional (or OO using an extreme functional discipline like all immutable types etc) because I don’t have that talent, focus and skill. My point isn’t that Haskell should be the language of choice. I think it’s a great language but I think e.g laziness makes it too hard to reason about performance and behavior. Today I’d recommend F# I think.
- Mirioron 7y agoAnd how many people dropped out of CS because of that first Haskell course? I saw plenty of people struggling with Python initially and I know exactly how they felt later when we had to learn Haskell. I think if I had to learn Haskell first, then I would've just given up at the start.
- alkonaut 7y agoI think they deliberately did some really “rough” math and CS classes up front because they knew some would drop out and they preferred them to drop in the first few weeks so someone could take their spot.
- thrower123 7y agoYeah, my university did something similar. The very first computer science course was a bog-standard Java course - this was often an elective that engineers or science folks took also. The first CS-specific course used Haskell, and it probably turned off 75% of the people that tried taking it.
- 7y ago
- macando 7y agoI always wondered whether imperative languages feel more intuitive to most programmers because they are: a) Inherently simpler and require no prior advanced knowledge of math. b) They are the default in every curriculum and once your brain is wired that way everything else seems counter-intuitive. I remember in the first grade of my elementary school we were taught basic algebra and how sets work (union, intersection etc). I understood both concepts but I couldn't relate sets to the outside world. Like why do I even need this. Maybe new programmers feel this way about functional languages and Haskell.
- ThrowawayR2 7y agoTry: c) That's the way microprocessors actually work. Machine language is just imperative commands and branch instructions.
- foxes 7y agoMirroring some of the comments here, just because you don't understand the internals does not mean you can't pick it up and be productive with it. This is what you do with any other language, but it just seems more natural to you (even though they are really just as complicated). Hence I feel like one of the big issues is that people learn to program in a non declarative/imperative way. When you first pick up python / c / c++ etc, there are plenty of details you don't necessarily understand (who here has absorbed all of the c++ spec?). At most Haskell is just different and I don't think it requires more mental effort than anything else.
- kunos 7y agoHonestly I think Haskellers should spend less time writing blogs and more time writing code that does something interesting/useful. When the language you claim being so superior comes with such bad tooling and usability your claim instantly looses any substance.
- yakshaving_jgt 7y agoStrange. I spend the vast majority of my time writing code that does something interesting/useful. In fact, it puts food on the table and a roof over the heads of several families. The reason why I’ve given up my own time to write some blog posts (apart from it just being an occasional pastime), is that everyone complains that Haskell doesn’t have enough documentation or tutorials. Damned if we do; damned if we don’t.
- tome 7y ago* "Haskellers write to much code but don't explain the language. They should write tutorials." * "Haskellers just write tutorials but there's no good practical code." * "Haskell will never catch on because it's too hard. They think it's easy but that's just because they're geniuses." * "Haskellers are obnoxious and condescending. The language is easy but they want to pretend it makes them special and clever." * "The Haskell type checker only checks really simple properties that are easy to prove by hand" * "Haskell doesn't come with tooling that automate refactorings that are easy to make by hand" The list of contradictory complaints goes on ...
- verttii 7y agoWe absolutely need more hands-on Haskell tutorials and blogs. I've been massively more productive with Haskell with the help of just a few well written blogs that are full of tutorial posts. We got a lot of books detailing various type theories, algorithmic nuances and so on in Haskell, but very little resources to actually help anyone get off the ground with practical web development.
- tome 7y ago> I've been massively more productive with Haskell with the help of just a few well written blogs that are full of tutorial posts. Could you share some examples? It's probably a good idea to promote useful content!
- aaronmu 7y agoThe company I work for defaults to F# when choosing tech for a specific project. We defaulted to PHP and C# in the past. We have quite some experience training people who just graduated and even people with backgrounds outside of tech. Training someone from zero to autonomously writing production code is a lot easier in F# compared to PHP and C#. We educate people in Elm and Haskell and switch over to F# when they’re ready to try building the first real thing end to end.
- thrower123 7y agoF# is really a very nice pragmatic language. C# keeps cannibalizing features from it, which is both good and bad...
- bob1029 7y agoAs a die-hard .NET/C# developer, I would be curious what you perceive to be the 'bad' side of that coin. I assume something like LINQ would be classified as 'good'?
- BeetleB 7y agoWhat he meant by bad is probably the fear that MS will abandon F# once C# has borrowed enough features from it.
- thrower123 7y agoThe other unfortunate is that as C# accretes features, the old still hangs around. Eventually you end up with too many valid ways of doing things, and cruft that either can't be worked around or was never updated. It's been over a decade since generics were introduced, but I still encounter code using ArrayList today...
- ngcc_hk 7y agoNot la. Clojure.
- mac01021 7y agoLearning Chinese is no harder than learning any other language. Unless there's a language you already know that is unlike Chinese and more like other languages.
- thrower123 7y agoLearning Chinese is objectively more difficult than learning alphabetic languages. Although learning Chinese really would be more like learning APL.
- AnimalMuppet 7y agoThat's written Chinese. Learning spoken Chinese is more difficult if you're not used to a tonal language, though.
- JanisL 7y agoMaybe things have changed since 2005 when I first used it but Haskell was certainly harder for me and the people I knew to learn than other languages. For languages of a similar power I can see Haskell being similar difficulty to learn. But compared with something like Python the amount of effort needed to go from zero knowledge to being able to write some sort of program that produces some useful real world results is much higher in Haskell. I say this as someone who quite likes Haskell, when you have a problem that fits well with Haskell it's really amazing.
- yakshaving_jgt 7y agoThings have changed significantly in the last four years, so they definitely will have changed a huge amount in the last 14 years.
- agumonkey 7y agoI'd argue that it's not as simple. But there's a relativity factor here. 1) Haskell is much like math. You look at some concepts and ideas and fail to see what it is about, until 20 years down the road you finally click that "maaan" discrete mathematics was already encompassing 90% of computation it just wrapped it in counting instead of concrete computer instructions. Mathematicians have this culture of going too far, too concise, too fast for most of the population. 2) Mainstream culture imposes a negative toll on this because when you're fed Java or PHP (let's say you learned in the 2000s when they were peak fad) you'll interpret Haskell through them, brain already set on a belief, and it will make it twice harder. And it's really hard to disentangle the weird bliss of being able to manipulate elements through an interface (here it would be the syntax its idioms) from "objective reality". I too was enamored by PHP associative array syntax (so fun compared to C or Java lack thereof) and F5 to see a website change before my eyes. Haskell feels like a punishment compared to this. Not even counting the social aspect of it .. wordpress made people have colleagues and money. Anyway, keep learning haskell (and FP, and logic, and math).
- defanor 7y agoI mostly agree with the article, but not with the HN title (which doesn't match the article's title). The article itself has a nice statement: > If you’ve already learned another language, you can learn Haskell. And even if you haven’t, learning Haskell is no harder than learning any other programming language. But most of the programmers are familiar with imperative languages, and can quite easily switch between them (possibly writing non-idiomatic and awkward code, but without having to really learn the language from scratch to do so). While a purely functional language with unfamiliar syntax doesn't let one to do it as easily. So indeed, if you haven't learned other languages, probably it's not harder, and if you have, you still can learn it, but likely it would be harder to learn than other imperative languages if you are already familiar with a few imperative languages.
- tome 7y ago> I mostly agree with the article, but not with the HN title (which doesn't match the article's title). I think the HN title used to be correct. Perhaps the mods changed it. I can't imagine why. It's a completely different claim from the article!
- bryanrasmussen 7y agoIf learning it is no harder than any other programming language that presumes that every other programming language is equally easy to learn. Furthermore it assumes that people have an equally easy job learning whatever language they learn. Neither one of these conditions are remotely indicated by research on the subject, therefore the statement is false. Also I did try learning Haskell at one point and I found it harder than some other languages, I would say I found it Erlang level hard which I tried at about the same time( about 2009) but I think Erlang has a little more inclusiveness to their community IMHO
- yakshaving_jgt 7y ago> Neither one of these conditions are remotely indicated by research on the subject, therefore the statement is false. What is the standard unit of measurement for quantifying just how difficult a language is to learn? Is there a standard unit of measurement for quantifying the competence of a person learning a programming language?
- bryanrasmussen 7y agoI'm pretty sure the field is too young to have developed a standard unit of measurement of either of these things, if there were such units their creation would be one of the stunning intellectual achievements of mankind in recent history and would have such obvious benefits to many other parts of human endeavor that I would expect it would be a field more investment heavy than machine learning at the moment. However it has been shown that there are people who seem more attuned to different learning styles, styles of programming, there are differences in difficulty between first language acquisition and later (dependent on language similarity, language domain), and many other studies regarding programming language learning that it can be said not everyone learns equally well every language, and not every language is equally as learnable.
- yakshaving_jgt 7y ago> it can be said not everyone learns equally well every language, and not every language is equally as learnable. I think that’s reasonable, but the question is then at what point does a language become sufficiently difficult that it no longer provides a good return on investment? And to what degree of proficiency must one achieve in a language in order to productively use it? It doesn’t take a long time to learn all of Elm, and you can be productive in it quickly. It takes a very long time to learn all of Haskell, but it does not take a very long time to be productive with it.
- pi-victor 7y agoi've learned rust in a month of coding sparsely. in fact, i'm as comfortable today at writing rust as i am at writing go. i've been struggling to learn haskell for over half a year. i think it's an amazing language, don't get me wrong. but the fact that haskell is not harder to learn than any other programming languages is false. after taking a few online course, tutorials and so on, i still believe it's one of the most interesting (if not the most interesting) programming language in existence and also the hardest.
- tome 7y agoDid you click through to the article? The HN title is (currently) "Learning Haskell is no harder than learning any other programming language". The article's actual title is "You are already smart enough to write Haskell". You appear to be responding to what a zealous mod wrote not what anyone actually believes. (See also https://news.ycombinator.com/item?id=21171360 https://news.ycombinator.com/item?id=21171360)
- Elrac 7y agoAs a Haskell n00b, I'd like to mention something I can do in about 20 other languages but not in Haskell: ( UPDATE: I stand corrected, in a reply by tome. ) I'm writing and debugging some functional code - in Clojure. There's a function I've smoke-tested on its own but that's failing me with "real" data. Lacking a decent debugger for Clojure and being too lazy to isolate my problem into a test setup, my tool of choice is the lowly "debug print." In Clojure, the body of a function is essentially imperative, and I can insert a `(println "label:" value)`. To do the same thing in Haskell, I'd have to restructure my whole damn program. I understand the rationale for purity in Haskell, but sometimes I see it as badly standing in my way of accomplishing what I want to do.
- tome 7y agoHave you heard of Debug.Trace? It gives you exactly what you are looking for. https://hackage.haskell.org/package/base-4.12.0.0/docs/Debug-Trace.html https://hackage.haskell.org/package/base-4.12.0.0/docs/Debug...
- Elrac 7y agoWow, cool! Thanks. I hope to do more with Haskell once I retire, and this may stand me in good stead. I think my point is still supported to some extent by the fact that this is knowledge from outside of the language that I'd need to know to accomplish. It's something I need someone helpful like yourself to tell me about. Also something that only works because this library deliberately breaks Haskell's rules.
- tome 7y ago> Wow, cool! Thanks. I hope to do more with Haskell once I retire, and this may stand me in good stead. I'm glad it was helpful. > It's something I need someone helpful like yourself to tell me about. In general we're happy to help but it does annoy us when people make assumptions about what it's like to program in Haskell without actually trying it. If you'd like help I can suggest Haskell Reddit https://www.reddit.com/r/haskell/ https://www.reddit.com/r/haskell/ or emailing me personally http://web.jaguarpaw.co.uk/~tom/contact http://web.jaguarpaw.co.uk/~tom/contact > something that only works because this library deliberately breaks Haskell's rules. Only if you have very punitive assumptions about what Haskell's rules are, like those who have never used the language often do. People who actually write Haskell programs have other ideas.
- nickbauman 7y agoI remember Rob Pike unveiling Go at a Google talk years ago and some Googler got up and said "why would Go be better than Haskel?" and Rob said "Because I can't understand Haskel source code and I'm pretty sure you could understand Go source code right now."
- arendtio 7y agoI think this is still one of the strongest selling points for Go. It is a pretty solid language with a few basic concepts which are repeated constantly. Sure, it doesn't have generics, error handling is a mess and the language design isn't as consistent as it should be. But what it does, is pushing everybody to write simple code which is easy to understand. So many times I found the documentation (of some library) to be incomplete, but jumping right into the code answered the questions I had. I can't say that about every language.
- nickbauman 7y agoTotally agree. When I first encountered Go, I kinda hated it for its lugubrious combination of being rather "braindead" and opinionated about being braindead at the same time. Typing it every day gave me flashbacks of programming Java circa JDK 1.4 (before the compiler-only based generics were introduced in 1.5, which I still believe didn't solve enough problems for the complexity it added). In short, it felt like a step backward. But after seeing its gc performance sitting at the single-digit ms timeframes with huge heaps (60 gigabytes!) I realized I needed to hold my nose. What helped me make peace with it is its automated testing story. It's baked into the language in a way I've rarely seen in any other runtime.
- vojta_letal 7y agoI am a skilled Scala developer with knowledge of FP sufficient enough to make two contributions to the Typelevel cats/kittens ecosystem. Yet I was not even able to start a hobby project in Haskell. I always start and fall back to Python shortly after. Is it just me?
- agumonkey 7y agoThat's actually interesting. Was it the base prelude typeclasses that are too different ? AFAIK scala uses monadic code too .. I expected not too much difficulties using haskell. Maybe that's the syntax ?
- vojta_letal 7y agoScala has an awesome IDE support, familiar rich JVM ecosystem, familiar syntax, ability to ignore the fact that logging is a side effect... I had a hard time understanding the Haskell ecosystem, plus the syntax is just way too different and restrictive. For example the last tutorial I tried to follow recommend using nix package manager to install Haskell. I failled missereably, it just did not work out of the box.
- agumonkey 7y agoI see, I had more luck using stack but I understand it was a matter of luck. someone should make a haskell fiddle for newcomers ps: I wouldn't think that syntax would matter that much, was Scala your first FP language ?
- lngnmn1 7y agoThe real issue with Haskell is over-abstraction by narcissistic idiots - look how smart I am, I could encode it this way. This is precisely why we have shitty libraries, bullshit code bases and a half-gigabyte binaries (hello, hie). Miranda had nothing of this bullshit. Ocaml is also sane. Over-absraction by idiots is the diagnosis.
- yomly 7y agoImagine you spent a career learning the piano. Would you expect to pick up the violin as if you were an expert? Would it be reasonable to declare violin sucks! I've played piano for 30 years, vibrato is so hard it must be wrong, tell me why I should learn the violin? Actually probably a lot will come with you, your dexterity and music theory will be quite useful, as will your ear. But really, the instruments are very different and if you want to level up your sense of pitch or really learn how to sing a melody, the violin can be great for that...
- cuddlecake 7y agoAre you replying to the wrong link? The link is about programming fyi
- yomly 7y agoI'm trying to draw analogy to maybe something less inflammatory. Most of us here are programmers, a lot of us professionals. Music is the output of musicians, as perhaps code is the output of programmers. But music comes in all kinds of flavours: classical vs jazz vs pop Performance vs composition Recital vs improvisation And then choice of instrument within any of those areas. I feel a lot of people misplace their aversion to Haskell because they fail to recognize how different Haskell is. It's a bit like when English speakers think Chinese is a "hard" language. It's not, linguistically it's actually a pretty simple language (whether the script is easy/hard is up for grabs...) Actually Chinese is just different to English so you have few anchors and familiar friends to base things off so it feels hard cos you're starting afresh, like a child. And yet children of a china manage quite fine learning chinese.... Meanwhile, ask a Spanish speaker about their experiences learning Portuguese...
- ummonk 7y agoViolin is definitely much harder to pick up than piano though, regardless of experience with other instruments. Obviously mastery is hard for both, but getting a basic pleasant melody out of a piano is far easier than doing the same with a violin. Haskell is rather similar to a violin in that respect.
- 7y ago
- macawfish 7y agoIt's not the language that's frustrating to learn, it's the tooling.
- ConcernedCoder 7y agoYeah, ok, let's say it's true that it's no more difficult to learn Haskell as opposed to any other... with a mindshare of 0.29% ( according to something like this: http://pypl.github.io/PYPL.html http://pypl.github.io/PYPL.html ) isn't that like saying that it's no more difficult to learn "Upper Egyptian Arabic" ( see: http://pypl.github.io/PYPL.html http://pypl.github.io/PYPL.html ) rather than something a little more esoteric? ... i.e. WHY would you want to learn it unless you have a very specific use-case, i.e. moving to Egypt (edited for a word)
- tome 7y agoDid you click through to the article? The HN title is (currently) "Learning Haskell is no harder than learning any other programming language". The article's actual title is "You are already smart enough to write Haskell". You appear to be responding to what a zealous mod wrote not what anyone actually believes. (See also https://news.ycombinator.com/item?id=21171487 https://news.ycombinator.com/item?id=21171487)
- ConcernedCoder 7y agoMy point was/is that even if it IS easy to learn, relatively speaking, WHY would you want to learn it when it's obviously a niche language... I mean a REALLY small niche at that...
- Mugwort 7y agoHaskell basics are easy to learn. Nobody learns Haskell to linger on the basics. Haskell is a useful tool for express a deep ideas which aren't basic and require time, effort, focus and guidance to learn properly. You can still do quite a bit with the basics. I solved many Euler problems using Haskell and prefer it over Python.
- nec4b 7y agoThere are languages that attract people who want to get things done (mostly multi paradigm languages these days) and there are languages that attract people who want to feel special (languages oriented on one true way or obsessed with a particular purity).
- deleted 7y ago[deleted]
- ben509 7y agoI'm not sure the idea of a "beginner" language should be a design goal, and I don't think Haskell being a hard langauge to learn means it's a bad langauge. Easy as a design goal has led to many languages like AppleScript that try to ape natural language, or to visual languages, and those consistently seem to be bad choices. Haskell is probably not as hard as many people who haven't made the jump think it is. But it is hard. > What do you need to write real Haskell? The core of the language is extremely simple. If you understand how to write and use [four items broken out below] then you already have everything you need to write useful programs that solve real-world problems. The core is admirably simple, but simple doesn't mean easy. Easy to learn is when you have intuition and existing skill that readily map to the core constructs used in a language. > pattern matching There are cases where pattern matching is obvious, but this is not how most people have learned to structure a problem. People aren't naturally good at breaking problems into parts, that's a skill you have to develop over two or three years, which is my guess from observing myself and peers. > sum and product types Explicit types are already hard; you're already excluding many people who have trouble making the leap from Javascript to Java. But Haskell's type system is heavily generic. And its support for container types is not so great. Making them easy was a major reason Perl, Python and Ruby grew quickly, and landed us a ton of horrible code. To understand how Haskell makes these container types hard, compare the API for Data.Map to the API for java.util.Map[2]. You can ignore Java's rather pathetic facilities for FP entirely because you don't need them. The Haskell version has functions to do lookup, union, intersection and various predicates. In Java, they're trivial to implement with a loop. > pure functions and values The intuitive way to change a thing is... well, to change a thing. I can express it directly in plain language. To express the pure way, I have to describe it as "construct a new value such that all properties are the same except for the changed properties." I've seen a meme that shows Common Core multiplication in a pedagogical context, and contrasts it with the traditional long-form multiplication. It completely misses what CC is trying to do, but it's useful in showing what people are comfortable with: they grok procedures much better than abstractions. Functions are the part of math where most people who were okay with algebra nevertheless started tuning out. First-class functions are weirder still. Haskell also mandates currying, and being strongly typed every function gets a confusing type signature. All that said, keeping track of state changed by mutation is deceptively hard. It's a case where your intuition routinely leads you to build things you can't maintain. But sticking strictly to the claim in the OP, it's easy to learn to mutate state but hard to do. > how to glue together IO to make side effects This shows that monads are core to the language, and they have all the difficulties of generic types as well. Everyone has jumped on how hard monads are already so I won't belabor the point, just to say that except for concurrency / parallelism, I don't think there are any core language features as hard to understand as monads. (And I'm not sure exactly what the "core language" is, but I think anything in the Prelude is fair game.) Haskell does make them dramatically easier with "do" notation, but I think you really do need to grok monads for your learning to progress beyond simple examples. [1]: https://hackage.haskell.org/package/containers-0.6.2.1/docs/Data-Map-Lazy.html https://hackage.haskell.org/package/containers-0.6.2.1/docs/... [2]: https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/util/Map.html https://docs.oracle.com/en/java/javase/12/docs/api/java.base...
- spicyramen 7y agoI took a Haskell class couple of years back (Functional Programming) as reference I worked for 12 years before as Software Engineer using Pascal, C, C++, Java, Perl, Shell, Python, Visual Basic, and I felt like I was learning Chinese, I really put extra effort, but Monads, Applicatives, etc were complicated and way above my head. I really never found a reason to continue that punishment, I admire the teacher and the community who work on it, maybe not for me. But not easy
- rmtech 7y agoCan anyone recommend an intro to Haskell for me? ~4 years of Python experience and a math background. Ideally something online/interactive ...
- tome 7y agoThe canonical source for Haskell introductions is the following, I believe https://github.com/bitemyapp/learnhaskell https://github.com/bitemyapp/learnhaskell
- ummonk 7y ago>What do you need to write real Haskell? The core of the language is extremely simple. If you understand how to write and use >pure functions and values >pattern matching >sum and product types >how to glue together IO to make side effects You can do pure functions, pattern matching, and sum and product languages in plenty of other languages that have much more user-friendly syntax, community, and documentation. Also doesn't hurt that they have impure IO so you don't have to jury-rig impure IO using a monad.
- tome 7y agoI don't think what you say contradicts anything in the article ...
- ummonk 7y agoIt does. Haskell is harder to learn than other languages because it has a difficult syntax, navel-gazing community, and complex documentation.
- tome 7y agoYou're right! Turns out it's me that hasn't read the article. Anyway, remove the sentence about it not being harder to learn than any other language (which I think is unfortunate) and then I don't think what you say contradicts it. Haskell can be very hard to learn yet still within reach of most programmers.
- viburnum 7y agoWhen I tried to learn Haskell, I tried doing the kind of stuff I usually do in Ruby: parsing log files, converting text formats, etc. It seemed hopeless. I'm curious to hear about the experience of someone who uses Haskell for everyday tasks. Does anyone do that?
- iLemming 7y agoI've struggled with Haskell for a long time. Surprisingly, learning Clojure made many Haskell concepts clear and more approachable for me.