23 October 2010

Concepts of Functional Programming

Last week I had the pleasure to give a presentation at Javaabend in Vienna. Javaabend (German for Java evening) is a local Java user group event organised by openForce Information Technology at irregular intervals.

LambdaA 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.

Slides
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.)

MonadsDiscussion
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?
These are difficult questions, only time will tell.

ResourcesAcknowledgement
Researching the core principles of functional programming was part of a System One Research Day.

4 comments:

basetta said...

As you said without script are not really useful :) That means i will drop by next time to this JAvaAbend :)

Peter Kofler said...

Yes, you definitely should. It's a friendly community. See you then.

Peter Kofler said...

Neal Ford's talk Functional Thinking from last year's JavaZone explains some of these concepts very well. I recommend watching it.

Peter Kofler said...

I just uploaded a brushed-up version of the slides to Slideshare for more convenient consumption. Enjoy!