Here’s what I would love your help with.
- Take a look at the current code samples and let me know where you see opportunities to simplify or design seams that I missed. This effort is as much about me learning/improving my functional chops as it is sharing what I’ve discovered with you.
Now, while I have no idea where this all may go in the end, allow me to share with you one thing that I’ve learned from working through the currently posted scenarios. It can be difficult to write functional equivalents to smaller blocks of imperative code because reasoning in functional programming terms seems more natural at a higher level of abstraction than imperative code. Much of the imperative logic that I looked at dealt with checking for null values on individual variables, or branching statements, or loops, and so on. Reasoning about this kind of code can be done in functional terms, but I believe the more valuable application would be to apply a functional design at a larger scope, and thereby eliminate the need for much of those lower level statements in the first place. Put another way, I find functional design to be an effective tool for expressing code’s intent.