News for hackers. Stuff that matters.
Re:Teach yourself Computer Science functionally by weatherlight on Tuesday June 13, 2023 @05:38PM (#36317839)
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.)

Re:Teach yourself Computer Science functionally by whateverman23 on Tuesday June 13, 2023 @07:20PM (#36319040)
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.

Re:Teach yourself Computer Science functionally by weatherlight on Wednesday June 14, 2023 @01:44AM (#36321897)
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

Re:Teach yourself Computer Science functionally by worrycue on Wednesday June 14, 2023 @03:17AM (#36322570)
Learning and using are 2 separate things.

FP is supposedly easier to use in the long run but it’s definitely harder to pick up.

Imperative is the opposite since it’s analogous to writing out a list of things you want the computer to do - a concept even the uneducated can understand.

Re:Teach yourself Computer Science functionally by itronitron on Wednesday June 14, 2023 @02:28AM (#36322160)
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.
Re:Teach yourself Computer Science functionally by weatherlight on Wednesday June 14, 2023 @10:35AM (#36326663)
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.