From Objects to Functions (Pragmatic Bookshelf)

PragmaticBookshelf
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 “devtalk.com" at checkout :+1:

Latest Threads About This Book Top

systame
@uberto I’m evaluating a sample of this book to see if I want to buy. Trying sample code in idea. Tried running ‘Spike.kt’ and get the f...
New
DanielZ
@uberto On page 34 in “Designing with Arrows” we reference to getToDoList() of the Zettai class in fact we defined on page 32 a showList...
New
DanielZ
In our first acceptance test we expect according to page 33 “An operation is not implemented: parse the response” - in fact we receive “H...
New
DanielZ
In “The First Acceptance Test” there we have expectThat(list.name)... in our ToDoList we defined the property on page 32 as listName
New
DanielZ
@uberto On page 51 “Run the Acceptance Test” in the last sentence shouldn’t it be “With the acceptance test in place we can now start to...
New
yonvata
@uberto On page 226, the book defines the object ListCreated with the attributes id and name, however, later on page 228 we see in the t...
New
yonvata
There are a couple of typos and unclarities in exercise 4.x: 4.3: the text shows that the expected output of the following code should ...
New
yonvata
On the refactoring of the test from the acceptance test to DDT test the book introduce a new class called SeeATodoListDDT which uses the ...
New
yonvata
@uberto In exercise 3.4 the renderTemplate function looks as follow: fun renderTemplate(template: Template, data: Map<String, Strin...
New
yonvata
@uberto The book states in each exercise that the solutions are available in the book repository, but there’s no link to such a repo. I’...
New

Most Active This Week Top

Most Active This Month Top

Most Active This Year Top

DanielZ
@uberto On page 34 in “Designing with Arrows” we reference to getToDoList() of the Zettai class in fact we defined on page 32 a showList...
New
DanielZ
@uberto On page 51 “Run the Acceptance Test” in the last sentence shouldn’t it be “With the acceptance test in place we can now start to...
New
systame
@uberto I’m evaluating a sample of this book to see if I want to buy. Trying sample code in idea. Tried running ‘Spike.kt’ and get the f...
New

Most Active Last Three Years Top

mikezx6r
@uberto I’ve only begun reading the book, and like what I see. Doing the first Test portion around addition, and wondering if you’ve eve...
New
PhBastiani
@uberto Page 54 : Functional programming is the art to minimize the side-effects code and keep it at the outer edge of your programs. =...
New
PhBastiani
Hello Uberto, We agree : We can say that referential transparency describes the purity aspect of functional programming. But IMHO, for a...
New
yonvata
@uberto The book states in each exercise that the solutions are available in the book repository, but there’s no link to such a repo. I’...
New
thomo
@uberto Also, note also the use … correct Also note the use The type of an external function is declared differently … correct Th...
New
thomo
@uberto In you can replace all the expressions … correct If you can replace all the expressions …
New
New
gypsydave5
Uberto Barbini @uberto Much as I like the idea of “inside-in” development, probably should be “inside-out”
New
Ted
Eric Normand. Grokking Simplicity: Taming Complex Software with Functional Thinking. The Pragmatic Bookshelf, Raleigh, NC, 2019. Another...
New
DanielZ
In “The First Acceptance Test” there we have expectThat(list.name)... in our ToDoList we defined the property on page 32 as listName
New
DanielZ
In our first acceptance test we expect according to page 33 “An operation is not implemented: parse the response” - in fact we receive “H...
New
stigro
finally compile acceptance test → finally compile the acceptance test but the test still fail → but the test still fails
New
yonvata
@uberto On page 226, the book defines the object ListCreated with the attributes id and name, however, later on page 228 we see in the t...
New
yonvata
On the refactoring of the test from the acceptance test to DDT test the book introduce a new class called SeeATodoListDDT which uses the ...
New
yonvata
@uberto In exercise 3.4 the renderTemplate function looks as follow: fun renderTemplate(template: Template, data: Map<String, Strin...
New

Most Active Over Three Years Top

PragmaticBookshelf
Learn Functional Programming by building a complete web application that uses Kotlin, TDD with end-to-end tests, and CQRS and Event Sourc...
New
yonvata
There are a couple of typos and unclarities in exercise 4.x: 4.3: the text shows that the expected output of the following code should ...
New

Get money off!

The Pragmatic Bookshelf

35% off any eBook

Simply use coupon code "devtalk.com" at checkout. See full details here.