Trying to Understand Functional Programming
I don't often write about the little nuggets of knowledge my boss, Bill Wagner of SRT Solutions, passes to me, usually because it takes so long for me to completely understand them. The latest thing he has me pondering is functional programming. First, here is the Wikipedia definition of Functional Programming:
In pure functional programming, there are no objects and no mutable variables (all variables can only be assigned once, which makes them not very "variable"). You only have functions and non-mutable variables. Interestingly enough, functions can be passed to other functions. This is the point where it falls apart for me. Functions being passed to other functions is kind of tricky. What's worse, is that you can just pass the code for a function to another function. That is REALLY weird. Imagine a paramter being "x + y/2 - z". Without writing any code, I think I have reached my limit of understanding. More research is definitely needed.
For more on Functional Programming, I found this article very helpful. I would also watch Bill Wagner's blog for speaking engagements. He's been doing a lot with FP in recent months. Catch it before he moves onto something else.
Functional programming is a programming paradigm that conceives computation as the evaluation of mathematical functions and avoids state and mutable data. Functional programming emphasizes the application of functions, in contrast with imperative programming, which emphasizes changes in state and the execution of sequential commands.A bit dense, but you can glean some things here. First, it's all about functions. Second, it avoid mutable data (variables). Third, this is a lot different than what you are used to (at the risk of sounding clairvoyant, you are used to imperative programming).
In pure functional programming, there are no objects and no mutable variables (all variables can only be assigned once, which makes them not very "variable"). You only have functions and non-mutable variables. Interestingly enough, functions can be passed to other functions. This is the point where it falls apart for me. Functions being passed to other functions is kind of tricky. What's worse, is that you can just pass the code for a function to another function. That is REALLY weird. Imagine a paramter being "x + y/2 - z". Without writing any code, I think I have reached my limit of understanding. More research is definitely needed.
For more on Functional Programming, I found this article very helpful. I would also watch Bill Wagner's blog for speaking engagements. He's been doing a lot with FP in recent months. Catch it before he moves onto something else.
Labels: General Programming






0 Comments:
Post a Comment
<< Home