From Objects to Functions (PragProg)

Learn Functional Programming by building a complete web application that uses Kotlin, TDD with end-to-end tests, and CQRS and Event Sourcing microservices architecture.

Uberto Barbini @uberto

edited by Adaobi Obi Tulton @aotulton

Build applications quicker and with less effort using functional programming and Kotlin. Learn by building a complete application, from gathering requirements to delivering a microservice architecture following functional programming principles. Learn how to implement CQRS and EventSourcing in a functional way to map the domain into code better and to keep the cost of change low for the whole application life cycle.

If you’re curious about functional programming or you are struggling with how to put it into practice, this guide will help you increase your productivity composing small functions together instead of creating fat objects.

Switching to the functional paradigm isn’t easy when you’re used to object-oriented programming. You need more than just lambdas and mapping over collections to get a declarative style and disentangle the state from the computations. Use transformations and compositions to help you write less code with better results. Boost your productivity and harness the power of functional programming by creating real-world applications rather than focusing on theoretical concepts.

Work through a series of short exercises to find and compose pure functions, and create data structures that work like algebra. Get rid of mutable state in your software to eliminate the main source of bugs. Apply CQRS and EventSourcing patterns to translate stakeholder requirements into functional design and then into code. See how Kotlin’s easy-to-learn syntax and functional-friendly approach make it a great option for a pragmatic language that integrates well with existing Java code and libraries.

Leverage functional programming to build and deliver robust applications in less time and with fewer defects.

Uberto is a very passionate programmer, starting when he created his first video game on the ZxSpectrum many years ago. He worked in all kinds of organizations, from the very big to the very small, coaching and helping teams build software in an efficient and sustainable way to create value for the company. He has used a range of functional languages (Haskell, Clojure, Scala), and he is currently in love with the simplicity of Kotlin and its productivity. He is a regular speaker at conferences around the world on Kotlin and Java, and he enjoys teaching courses and mentoring young programmers.

Don’t forget you can get 35% off with your Devtalk discount! Just use the coupon code “" at checkout :+1:


Corresponding tweet for this thread:

Share link for this tweet.


I am interested in this book, eventhough I don’t know Kotlin.


if you know Java it shouldn’t be a problem, Kotlin is quite similar and the differences are explained in the book.


Congrats on the release Uberto!

Do you think the book might be useful for people using other functional programming languages too? (I’m thinking Erlang/Elixir specifically) Or do you think it’s mainly a book to learn and use Kotlin? (Which is totally cool too!)

That’s awesome! :sunglasses:


I think it can be useful to people using similar languages (Java, C#, Typescript, and so on.)
I don’t know Erlang and Elixir well but I think are too different the code to be translated.
But the general ideas will be the same: TDD, event sourcing, thinking in term of pure functions etc.


I am very interested in this book.
Thanks for your effort Uberto Barbini :slight_smile:


I’m interested as well. Great topic! :+1: