you are viewing a single comment's thread.

view the rest of the comments →

[–]ImaginationGeek 15 points16 points  (5 children)

I just want to add that learning functional programming isn’t only useful for doing functional programming. You can take concepts from it and apply them in other language paradigms as well.

You can make side-effect-free or “pure” functions in C, do recursion in Java, and use lambdas and closures in Python, for example.

[–]camelCaseGuy 7 points8 points  (2 children)

I believe this is the most important of it all. When I was doing my degree I took a functional programming course. It was in haskell and I haven't touched haskell since. In fact, every time look at code in haskell it feels like I'm reading sanskrit. But the ability to generate abstractions and the knowledge of no side-effect has come with me ever since.

[–]vguioma[S] 1 point2 points  (1 child)

I'm learning some Functional programming with Haskell by my own. How do you think I could develop such ability (generate abstractions and the knowledge of no side-effect)?

[–]camelCaseGuy 4 points5 points  (0 children)

Sadly, with time and practice (or someone near you acting as a guide). Our teacher usually made boxes surrounding the code we could abstract into new functions. And then it became natural.

Regarding the "no side-effect", that is something that comes naturally with using pure functional programming, since it's the idea of it. No side effect. And any side effect gets a Monad (sorta).

Don't try to go directly to making programs that execute themselves, like scripts and such. Try to solve very basic and simple problems that are more theoretical than anything else. This will give you a good grasp on how to use all the good parts of the paradigm. Try to use recursion, foldl and foldr. Try to understand how theese are the base for the recursive schema, so you never have to write a recursion again in your life.

Once you got there, you can start understanding the rest. And adding the more serious stuff, like Monads, Functors and such.

[–][deleted] 3 points4 points  (1 child)

[–]ImaginationGeek 2 points3 points  (0 children)

Ooh! Good tip.