Wednesday, December 16, 2009

Composability as a way to control Complexity

I came across this great video of a conversation with Brian Beckman on Complexity in computing, on MSDN's Channel 9.

In that video Brian Beckman compares Inherent or Essential complexity (of the problem you, programmer, are trying to solve) and Accidental complexity (not inherent in the initial problem, but introduced by the many technologies and programming languages you have to use for example.)

He also introduces Functional Programming, how it limits the ways to hook things together and dependencies on the context in which software components executes, and how that makes it much easier to compose complex systems out of small building blocks.

In summary, Composability is the way to control Complexity, and functional programs are easier to compose.

Also, don't miss older talks and conversations with Brian Beckman, perhaps even more interesting:

Don't fear the Monads is an enlightening white board introduction to Functional Programming and Monads. Brian Beckman discusses Monoids (a mathematical concept representing a collections of things and rules to compose them that themselves follow some rules, like associativity for example), Monads (used to carry extra data around values, representing side effects for example, plus composition operators), and how they help you compose large and complex systems out of small function building blocks.

In The Zen of Stateless State, part 1 and part 2, he shows how functions with no side effects can still be useful in the real world, flow and alter state, and still be composed using State Monads (simple functions that take a state and return a state + content pair and an operator that can thread the state through a composition.)

Then he discusses how functions + monads force programmers to be explicit and very precise about what their code does (no undisciplined side effects under the covers of a function) and how that makes programs more reliable and composable.

Bottom line, mathematical precision is the key to software reuse and composition.

If you're not convinced, watch the videos...

No comments:

The postings on this site are my own and don’t necessarily represent positions, strategies or opinions of my employer IBM.