
Duncan McGregor
Google Developer Expert
Functional Programming - It's About Time
Learn how to think of programming in terms of immutable data, calculations, and actions to create more maintainable code.
Duncan has been a professional software developer for over 30 years now. He was lucky enough to be an early adopter of Object Oriented programming, which was the gateway drug to patterns and Extreme Programming, and more recently functional programming in Kotlin. These days he still writes code for a living, coauthored Java to Kotlin: A Refactoring Guidebook, is a Google Developer Expert, and publishes a weekly YouTube video on Kotlin.
He will try almost anything in his quest for better software, including, but not limited to, actually talking to people.
Talk Abstract
It’s easy to see functional programming in terms of immutable data structures and higher-order functions. But these are just tools that enable us to take control of our code.
This talk shows how to think of programming in terms of immutable data, calculations and actions.
Immutable data is timeless. Once you have a value it will not change.
Calculations are functions whose result depends only on their arguments, these also always give the same answer no matter when they are called.
Actions are the other functions, those with side-effects. A function with side effects may give a different result depending on when it is called - maybe reading the current time or from a global mutable variable or a file. Or it may affect the outside world, writing to a global or outputting a string perhaps. Side effects make code sensitive to when or how many times it is called.
In this session we will see how categorising our code this way allows us to reason with it and refactor in ways that are otherwise much harder.