Functional architecture - The pits of success - Mark Seemann
Why Hacker News recommends it
Recommended as a practical demonstration of how functional thinking improves design without going off the deep end.
What it is
Mark Seemann argues that functional programming naturally yields many of the best practices object-oriented developers learn painfully. He shows how functional architecture leads to a pit of success, with a pure core and impure shell.
Recommended by 5 HN commenters across 6 different months, 2018 to 2025.
What Hacker News said
Strong rec adamkl · 2020-10 · on “A Theory of Software Architecture”
I spend a lot of time thinking about these sorts of topics (actually, I just taught a 4 hour session yesterday that used most of the terms in this article), working with newer, less experienced developers, and trying to figure how to distill the essence of "architecture" down to something simple that everyone can start with. This is what I’ve started telling people: Use mostly functions, try to make most of them pure. I think that can get people (even new devs) 80% of the benefits (testability, composability, loose coupling, and the ability to reason about code) of more complicated, prescriptive architectures (Hexagonal, Onion, Ports & Adapters, Clean, etc) with a minimal amount of ramp up.
Strong rec Xunjin · 2021-07 · on “Habits of Expert Software Designers (2019)”
His videos about functional programming are amazing (Mark Seemann). "Pit of success" is one of the best. [this video]
Recommends pwm · 2018-09 · on “Functional core, imperative shell (2012)”
The goal is that everything in the core is pure data types and functions. Now, depending on your problem domain, your core can be small or huge compared to the shell. Your question was all about IO/effects. They are impure and belong to the shell. If what you work on does mostly IO then you will have a lot of impure code lying around by definition. Still, the idea is that you should keep the amount of time spent in impure land minimal, ie. drop into pure structures/computation as soon as possible during program execution and only dip out of on occasions when you have to do IO. Here is a good talk about these ideas: [this video]
Recommends adamkl · 2021-01 · on “Software engineering topics I changed my mind on”
> So while FP is just another tool, it's also a framework for thinking that helps people make better choices I’ve been getting more into functional programming this past year (via Clojure, though my day-job is mostly JavaScript/TypeScript) and this is the big takeaway for me. Type theory and monads may have their place, but thinking about separating logic from side-effects is, I think, the most valuable aspect of functional programming. That is a thought process that you can apply in pretty much any language that will give you the biggest bang for your buck. Edit: Here’s some great examples of the benefits of functional thinking without going off the deep end. 1. Boundaries by Gary Bernhardt
Recommends kirse · 2021-12 · on “F# Good and Bad”
Mark Seemann has a good talk on this called the "functional pits of success" -> [this video] Of all the languages I've used nothing is quite as fun as refactoring an F# app down to nothing. Expressive power is king in F# with the whole .NET ecosystem behind it.
Recommends tubthumper8 · 2025-04 · on “Why F#?”
"pit of success" from the previous comment might refer to this video, which is long but good especially to adjust to a different mindset [this video]
Cites truculent · 2019-10 · on “Learning Haskell is no harder than learning any other programming language”
> I don’t have that talent, focus and skill. Same. I'm perfectly happy to fall into the pit of success[1]. 1. [this video]
Cites kirse · 2020-11 · on “Dark’s new backend will be in F#”
good default behavior and how it nudges programmers to favor predictable and composable solutions Agree. Mark Seeman calls these the "Functional pits of success" [this video] I think the toughest thing about F# is that it doesn't offer as many Google-able easy solutions, so I'm stuck using it for utility and client libs at work. Trying to get a whole team onboard is a non-starter. It takes a good 6-12 months to adjust the mindset and most people are just looking to come into work, find their tough questions on StackOverflow and head out for the day.