User Tools

Site Tools


2013:refactoring_to_functional

This is an old revision of the document!


Back to proposals-2013

Title: Refactoring to Functional
Proposer: steve_freeman
Type: Workshop
Duration: 90 minutes
Description: Knowing functional techniques leads to better object oriented code, just as knowing about objects leads to better procedural code. The trick is getting from here to there.

At a previous XpDay, several of us found that we'd developed a similar approach to writing Java which includes a strong bias towards immutability and functional code within objects. The game changers have been a JVM that makes transient objects cheap, and Google nearly-lazy collections library. We've found that the resulting code style is easier to understand and less prone to certain kinds of bug. Working in this style, we've found that there are some common patterns for moving to a “functional-inside” approach to code.

In this workshop, I will present some techniques for moving from imperative to functional code, with worked exercises for the participants to join in.

Note: I think this will have to be a limited size session, unless I get someone to help out.
Note: I did this last year with some colleagues, but that was demo-style
Note: This version is based on Java. It could be ported to other languages that have equivalent functional constructs. I could get someone in to help with a port to C# if required.

Roger: Like the idea, are we stymied by the size limit?

2013/refactoring_to_functional.1354404518.txt.gz · Last modified: 2016/06/11 14:05 (external edit)