Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You don't need to know more than high school math to learn Functional Programming. This myth really needs to stop.

All functional programing languages, have ergonomics in their syntax and semantics. around referential transparency and immutable data structures, there's nothing in there about Monads or Functors or Hindley–Milner type systems.

Languages like Haskell do benefit from having that kind of experience, however, langs like, OCaml, Erlang, Elixir, Gleam, Racket, Clojure, Standard ML.... and the list goes on, doesn't require that kind of education.

(Antidotally, I find FP langs much easier to reason about and I have a background in the humanities. I just don't buy the advanced math argument.)



I don't know why you think I said high level mathematics knowledge is required to learn FP. I simply said that in my experience, those who found FP easier to learn than imperative programming tend to be those who have a background in high level mathematics. Not everyone follows this pattern, of course.

Remember, we're simply comparing FP to imperative programming. I'm simply not convinced that FP is easier to learn than imperative programming for the vast majority of newcomers, and that's what I'm arguing here.


Keeping track of all that state in one’s head is hard.

I think because of the limitations of FP it’s much easier for new programmers to reason about programs and honestly, learn to program.

New developers don’t have to micromanage the computer, the way that the would with an imperative lang.

For example, SQL isn’t FP, but think about the number of business analysts whose lives would be more difficult if the had to write imperative programs to fetch data from some sort of data store.

I think what in comes down to is simple vs easy. Imperative programming in the very very beginning is easy, buts not simple.

Because there’s all this implicit state in your program, as the program grows it becomes very very complex. It’s no longer simple.

There’s this really great talk about this idea by rich hickey, the creator of clojure, that dives into this in detail.

https://youtu.be/SxdOUGdseq4


That really depends on when the person took high school mathematics, and the extent to which function abstractions were emphasized. That was not a core part of the curriculum when I was in school, but it is now.


let me rephrase, you need the same level of math to do imperative programming as you do to do FP, which is high school math.

functions, algebra, assignment, etc.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: