A great article on functional programming...

http://www.defmacro.org/ramblings/fp.html

This article was a great overview of many of the aspects of functional programming. With what Micosoft is doing to the CLR and C# and VB it would seem that functional programming is making advances into the main stream. His article has imaginary Java samples and if you squint your eyes when he creates a class to hold a function you can see delegates.

I studied functional languages such as LISP and ML in college but quickly lost track of them after years of programming in corporate IT. To catch back up I've been spending the better part of a year studying functional programming concepts. While its been challenging at times, there have been alot of aha and oh yeah moments.

Since I have a great comfort level with C syntax I started my ride on the functional wagon with COmega. This is where I really began to "get" things like closures. I even found myself purposfully writing my own code to mimic a closure in good ol C# 1.0 for certain situations like Regex match evaluators. Once you see the "patterns" that higher order functions exhibit you can write them in plain imperative code. This will make you hunger for language constructs to do this work for you. Its like writing OO code in assembly language.

C# 2.0 Added true closures to the language with anonymous delegates. Woo hoo no more private nested classes to hold lexical context! (at least not that I write).

At PDC I got to see the preview of C# 3. This takes anonymous delegates a step further with "lambdas". There's lazy evaluation galore with LINQ. It would seem that MS has been bitten by the functional bug. Even the Atlas client APIs make good use of the functional elements of JavaScript.

I've also ventured out into IronPython and Ruby. These are great places to practice functional programming techniques.

The real challenge moving forward is finding the right balance. Theres no doubt in my mind that functional programming techniques are headed to the main stream. With the populatrity of Ruby and Rails and Microsoft adding functional capabilites into C# and VB the winds of change are blowing.

Link dump so I can keep track of what I'm researching:
COmega: http://research.microsoft.com/Comega/
LINQ: http://msdn.microsoft.com/data/ref/linq/
F#: http://research.microsoft.com/fsharp/fsharp.aspx
IronPython: http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython
Ruby: http://www.ruby-lang.org/en/
Ruby.NET: http://www.plas.fit.qut.edu.au/rubynet/
IronRuby: http://wilcoding.xs4all.nl/Wilco/IronRuby.aspx
RubyCLR: http://www.iunknown.com/articles/2006/06/19/rubyclr-drop-4
Atlas: http://atlas.asp.net/Default.aspx?tabid=47
#Smalltalk: http://www.refactory.com/Software/SharpSmalltalk/index.html
brianbec's blog:
    http://weblogs.asp.net/brianbec/default.aspx
    http://weblogs.asp.net/brianbec/archive/2006/06/01/Lambdas_2C00_-Closures_2C00_-Currying_2C00_-and-All-That.aspx


3 Comments

Comments have been disabled for this content.