A Little Rant
This presentation has a long history, so I will start with a little rant. Last year when I started playing around with Scala, we (read some enthusiastic employees) formed an informal study group to have a look at functional languages and Scala in particular. In the beginning we made good progress and had quite some fun and met biweekly. Unfortunately the organisation had a strange attitude to training (as well as to public relations) and we were disbanded. Being stubborn as I am, I managed to establish a budget from "another source" after some time and started preparing this presentation for the monthly "Developer Round Table". The presentation was postponed several times and in the end I left the company for good.
Scope of Presentation
Now let's come back to the presentation. Talking about the principles of functional programming is a bit off-topic for the Code Cop and it's just scratching the surface of the core principles: purity, higher order functions, closures, currying, continuations and (well not really) monads. I'm no expert on functional programming, so feel free to comment corrections or clarifications. Especially the concept of monads is a bit mysterious.
Download the Concepts of Functional Programming slides. As usual the slides are not very useful without my explanations because they entirely consist of single words and/or images. This is my take on the current presentation style. I received some good feedback on the style and especially the images. One attendee even told me that the images were "too" good for him, he was distracted by them. (Thank you Flickr community for all these wonderful CC licensed images.)
After the presentation there was an interesting discussion on the advantages of functional programming over the imperative style, e.g. Java.
- Is it easier to get things done with many lines of simple, imperative code, compared to one line of functional code (that most definitely does not look simple when you are new to the area)?
- Are the functional paradigms more difficult to comprehend? Is this the reason that functional programming isn't used as widespread as the imperative one? Would the average developer produce bad quality code when using functional languages?
- Slava Akhmechet explains functional programming for the rest of us. This is a nice overview and definitely worth reading.
- Tony Morris posted slides of his talk what functional programming means.
- Some code examples were taken from Ruby Blocks, Closures, and Continuations.
- A good resource for all concepts is Wikipedia.
Researching the core principles of functional programming was part of a System One Research Day.