In these slides, Martin sums up perfectly the challenges facing Scala adoption in the wider community: ‘extremists’ at each end of the OO-FP divide can be prompt to come out with their ‘pitch fork’s.
I’ve always perceived Martin as a software anthropologist who’d examine long and hard where learning opportunities might be, then come up with applications where most people would get the most benefits. This is just like Anders Hejlsbeg, or Rick Hickey. What you see is that these people bring tremendous value to the software development practice, there’s much to learn in closely listening to what they have to say.
Another way I found useful to look at Scala’s embrace of both OO and FP goes like this:
- OO provides the structural facilities, the scaffolding amenities, the brick layering capability if you wish. This is how you eventually render your product. You want to be able to tear these apart as you wish, throw parts away as you see fit. A building must obey some basic laws of physics, hygiene and citizenry to be acceptable for any housing purposes.
- FP provides the means for generalising behaviours that one wish to share and repeatedly reuse. You want predictability, stability and control here. This would be like being able to re-arrange your whole house such that bedroom, the kitchen, the living area, the computer corner or the dining area could be all be shuffled around in an unlimited configuration without having to rebuild the whole house – this is unrealistic in real-life, but we’re talking about software here.
By combining the two aspects, you get more ‘bangs for the bucks’ as they say. With my simplistic analogies, FP would be the content of your house, and OO would be the building frame. If you do it well, you can take your house content anywhere with you, but you usually discard the building frame or leave it behind.
There is no useful reason to be dogmatic about OO vs. FP. If someone doesn’t see the benefits of either then they should just pick what works for them, or avoid Scala. Coming from Java development background, or facing with a future with Java, Scala is a great platform to build sustainable solutions on.
Martin’s Slides – warning, Slideshare might require Flash – not my wish though ;-( :