:::: MENU ::::

Everyday functional programming – part 1 of ??

This is the first of a series of blog posts where I will be exploring how functional programming techniques are useful in the daily life of a working “enterprise software” developer.

If you, like me, began programming in the 1990’s, then you will probably have started in a procedural programming style with simple task orientated scripts, and then progressed to an object oriented style for its better fit with event orientated GUI applications. As the software craftsmanship movement has grown over the past few years, you will have honed your S.O.L.I.D. OO skills; and focussed on making your code maintainable & testable/ed.

Whilst functional programming has an academic & computational background; functional elements have begun finding their way into mainstream languages. In this series of articles I’ll be concentrating on the two languages I am most familiar with – C# and Javascript – and how exploiting the functional programming features in these can help to make the code you and I write every day more expressive & maintainable, and in some instances dramatically more scalable.

I won’t be trying to explain the concepts behind functional programming – others have done an exellent job of that already; so I’ll just link to them [1] [2]. Rather, I’ll be curating practical examples where a functional style can be applied to everyday programming problems.

  1. Higher order functions – simplifying loops
  2. Implementing the strategy pattern without an explosion of classes
  3. Side effect free functions – code that is easy to test & reuse

[1] – http://en.wikipedia.org/wiki/Functional_programming
[2] – http://www.defmacro.org/ramblings/fp.html

So, what do you think ?