Quality Begs for Imagination!

February 23, 2008

Michael Feathers: Quality Begs for Object-Orientation

"I think that most functional programming languages are fundamentally broken with respect to the software lifecycle. I realize that's a bold statement. Let me back it up."

The crux of Michael's argument is that imperative languages provide easier ways to "substitute one piece of functionality for another without editing". He calls the ways this can be done "seams". Some examples of seams mentioned in his post are: subclassing, preprocessors, function pointers(!), and link substitution.

(Check out his post to see the example Java code he bases his argument on)

He almost might have tricked me into thinking he had a point, but... function pointers? If he'll consider function pointers a seam, how do functional languages lack seams? Functional languages treat functions as first-class values, they can be passed as arguments to functions, assigned to variables, stored in data structures, be composed.... all of these properties, especially taken in combination, burst seams left, right, and centre!

I'm seriously disappointed to see someone involved with the "Beautiful Code" book lack the imagination to think of ways programmers could design adaptable code using functional languages.