Building a Sustainable CodeBase with FP
summary
Argues that combining functional programming, heavy unit testing and hexagonal ports and adapters architecture let Nubank scale maintainable services: 500 engineers, 400+ services and 25M customers. Shows newcomers shipping to production in two weeks by keeping domain functions pure, isolating IO in ports, using dependency rejection so controllers return intent data structures instead of performing effects, and replacing flaky end-to-end suites with unit plus contract tests. Outcome is far faster test feedback, fewer flaky failures and easier composition and reasoning.
AI-written summary · about
chapters (37)
- 0:00Building a sustainable architecture
- 0:27motivation
- 1:18smooth learning curve shipped code to production
- 3:15patterns among services
- 3:34functional programming A tests o hexagonal architecture
- 3:50a functional programming
- 5:04fp is about pure functions
- 5:26fp is about referential transparency
- 5:45what about the impure functions?
- 6:20we need to talk about side effects
- 6:40pure function - impure function
- 7:14not infecting your fp code with imperative code
- 7:43limit the amount of imperative code
- 10:02focus on what matters
- 10:32eliminate shared state so order does not matter
- 11:45confidence safeness
- 12:23live documentation
- 12:59accuracy
- 13:30speed
- 14:17reliable feedback
- 14:44e2e is a problem
- 15:36how to design our code?
- 16:37maintainability is a long term concept
- 17:11first attempt: hexagonal architecture
- 19:31tests in isolation with mocks and stubs
- 19:43dependency injection
- 21:30isolation is the dual of encapsulation
- 22:24hard to balance between both
- 22:55not a problem in FP
- 23:12hexagonal architecture in FP is natural
- 24:03good FP design is ports and adapters
- 24:26second layer with imperative code and side effects
- 25:39Mocks & Integration Tests
- 26:22hexagonal architecture with dependency rejection
- 27:35atomic operations
- 27:57data as first class citizens
- 28:17second layer without side effects
related talks
45mFunctional Programming in the Large - Status and Perspective
42mFunctional Programming in 40 Minutes
57mBuilding Systems that are #neverdone
57mMaximising Side Effects When Adopting Functional Programming
41m"Architecting systems through Engineering Principles"
32mFunctional Programming for (Dev)Operations and Infrastructure
36mYou Might Just be a Functional Programmer Now
55mThe Zen of Programming. A personal journey towards writing beautiful code
