Modern mainstream languages support object-oriented and functional styles of programming. What should we do when we have object-oriented code that should be functional? Refactor!
Guided by Nat and Duncan, you will gradually and safely transform a typical web application written in Kotlin, with a popular object-oriented framework, to a functional style better suited to today’s languages and architectures.
You will learn refactoring techniques to safely transform code from one style to the other, to best meet the changing needs of an application.
Topics include:
Benefits of thinking in a functional way, separating data, calculations, and actions
Refactoring from mutable objects to immutable data and functions
Refactoring state machines to algebraic data types
Choosing between top-level functions, methods and extensions
Where does the state live? The Functional Core / Imperative Shell architecture.
Type-level modelling to make invalid states unrepresentable
Functional error handling
Expand/Contract refactorings for safe transformation of code across multiple commits and deployments
Nat and Duncan are authors of Java to Kotlin: A Refactoring Guidebook. Duncan presents the popular Pairing with Duncan channel on YouTube.
This workshop will involve Kotlin programming. You will need a laptop with IntelliJ, Kotlin and Java 21 installed. You can use the free IntelliJ Community Edition.
You can choose to work in pairs or individually. If you are not familiar with Kotlin, you can pair up with someone who is, to get the most benefit from the workshop.
Nat Pryce is co-author of Java to Kotlin: A Refactoring Guidebook and Growing Object-Oriented Software Guided by Tests....
Duncan was a professional software developer for over 30 years, but is now trying to be retired. He was lucky enough to be an early adopter of Object Oriented programming, which was the gateway drug to patterns and Extreme Programming. He coauthored Java to Kotlin: A Refactoring Guidebook, is a Google Developer Expert, and publishes a weekly YouTube video on Kotlin....