Monday, November 4, 2013

Functional Programming

For this post, I will be reflecting upon what I've been spending most of my time on as of late: Functional programming.

So the concept of functional programming makes sense, coming from a strong mathematical background. The biggest hoop I am having to deal with when switching from a strictly procedural programming state of mind to a functional state of mind is dealing with recursion within iterations. So the concept of iteratively moving through a list makes perfect sense: it feels just like a for-each loop and operates pretty similarly. What I am having trouble with, however, is trying to create a lambda call (Ruby) within an iteration. Typically, a lambda produces a proc (or procedure) which you can then call with whatever value(s) that you like. Doing this while trying to iterate over a list of functions is baffling me, for some reason. Hopefully I can figure this issue out and update this post at a later point in time, but, for now, this will have to be cut short as I have to finish pulling the rest of my hair out finishing this assignment.

Update: So I have finally been able to get past my functional programming issue thanks to Lisa Smith. So I was trying go multiple calls deep with lambda functions, when really I just needed to use a mapping function in conjunction with my iteration. This makes a lot more sense and I escaped without pulling all my hair out.

On the bright side: I have gotten a jumpstart on my personal statement for graduate school applications and I have an outline set up for that. So hopefully I can knock that out this week and then be on a good track to knock out my research proposal/statement as well.

Music listened to while blogging: Aeroplane - In Flight Entertainment (Continuous Mix)

No comments:

Post a Comment