4 ms·
I don't really buy the "Haskell isn't friendly" thing - it's way more work and way less pleasant to become an expert in, say, C++, than to become an expert in H
by wyager 5y ago
I don't really buy the "Haskell isn't friendly" thing - it's way more work and way less pleasant to become an expert in, say, C++, than to become an expert in Haskell.
It depends on what, precisely, you are measuring the difficulty of. Are you writing a quick script? A complex software project? Trying to master the language? Is it a beginner programmer? A narrowly focused coder who only knows one or two similar languages? An experienced programmer with a wide breadth of knowledge?
In pedagogical terms, I found learning Haskell much friendlier when I was contemporaneously learning Java, C++, Prolog, etc. in university.
- shepherdjerred 5y agoBut the choice isn’t between Haskell and C++, the choice is between Haskell and any other language. I agree that C++ is a bloated, error-prone nightmare, and I avoid it for that reason. There are plenty of languages that are widely considered easy to learn/use (python, Java, JavaScript). One of the big reasons that Haskell is hard to learn is because it is purely functional. Writing idiomatic Haskell is dramatically different from traditional imperative C-like languages. Just to give an example - a few years ago I was taking an AI class which used Common Lisp (a functional language, but not purely functional). The first few tests/projects which required functional lisp programs led many of my peers to drop the class. I think part of this is because my school, like most, started students off with an imperative/procedural language (C++). If you have a clean slate (e.g. someone with zero programming knowledge) it’s probably just as easy to teach them Haskell as it is C++ or Java. Functional programming is great, and I love it, but many programmers don’t even have a firm grasp on recursion which makes pure languages like Haskell like a mountain to climb.
- jcelerier 5y ago> I think part of this is because my school, like most, started students off with an imperative/procedural language (C++). If you have a clean slate (e.g. someone with zero programming knowledge) it’s probably just as easy It's definitely not. Source: I know a lot of people who had Caml classes before C classes, C was much easier. Also in my school we learned C and LISP at the same time, most people also found C easier.
- shepherdjerred 5y agoThat's a really interesting data point! It's entirely possible that functional programming languages are just objectively harder to learn. I suspect that if someone has a strong background in mathematics they might take to functional programming easier than they might other languages. I could definitely be wrong though!
- wyager 5y agoC++ is an extreme example, but almost all students learn it or similarly unpleasantly complicated stuff like Java. > many programmers don’t even have a firm grasp on recursion I can’t say I ran into more than a few people like this and I don’t think any of them stayed in CS.
- shepherdjerred 5y agoI think anecdotes about other programmers that we (people who use Hacker News) know is a rather biased subset of all programmers. Most of of the programmers on this site are likely above average in terms of skill. There are plenty of programmers out there that learned at boot camps, universities with poor CS programs, or who are self-taught, who likely have a much less solid understanding of CS fundamentals. Many of those programmers have never needed to understand recursion. I went to a school with a very average CS program, and many of my peers struggled with recursion. There were more than a few who passed the class (Data Structures) and graduated alongside me despite not fully grasping the concept of recursion.
- wyager 5y ago> There are plenty of programmers out there that learned at boot camps Some of the best (functional) programmers I know learned (functional programming and programming in general) at boot camps. I think the predictor for FP proficiency is not education (and I hesitate to share my predicted predictors here). In any case, they certainly understand recursion.
- throwaway894345 5y agoHaskell can be unfriendly and still more friendly than some of the least friendly languages. I still posit that Python or JavaScript would be far more familiar (especially syntactically) to far, far more developers than Haskell or Nix.
- wyager 5y agoJavaScript and Python are both horribly unfriendly if your end goal is to write complex, reliable software. I say that as a big fan of python.
- throwaway894345 5y agoI largely agree, but the problem isn't the syntax, which is the bit I'm proposing borrowing into Nix. I'm not saying "Nix should have Python's performance or package management" or "Nix should be dynamically typed like JavaScript" (it already does) or any of the other things that make these languages a bummer for significant software projects. I'm saying Nix should be familiar and intuitive to as many programmers as possible, and most programmers can intuit their way around Python or JS syntax.