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

> how difficult is it to learn a functional language as your first programming one? Wouldn't it be trippy?

As easy as learning a dysfunctional one if not easier.

Now scheme may not be the best example of this as its syntax is entirely alien (then again all syntax is, when you've never developed), but the canonical is the following statement:

    x = x + 1
If you've never developed before, the only place where you've seen something like this is maths, and in maths this is completely nonsensical.

So learning imperative programming does require lots of deprogramming and reprogramming of your brain. Which make up most of the hurdles of learning an FP (or logic, or dataflow, ...) language later on: your brain (or its section that has to do with development) has been baked in imperative idioms and methods, FP languages not only don't use these but use completely different techniques to solve the same problems, so you have to "unlearn" the old ones and "relearn" the new ones.



I can corroborate that for people with no prior programming experience, but a significant math background (engineers, stat and math majors), the statement "x = x + 1" is befuddling to them. They have no concept of time in a sequence of imperative statements. That is, they don't intuitively understand that statements get executed, and that the state of the program changes (potentially) after each statement. It takes real effort on their part to internalize this idea.

Now, I'm sympathetic to your final paragraph, but having never taught functional programming to anyone, I can't corroborate it. Personally, I went through something similar when first learning how to think functionally.




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

Search: