u/ringbuffer__in r/Clojure • Recommends
#clojure#component#stuartsierra
Stuart Sierra - Components Just Enough Structure
111K subscribers • 135 videos on Hallway
- Recommended by 4 people: 2 on Hacker News and 2 in engineering communities.
- A classic. People kept recommending it from 2014 to 2024.
- Presented by Stuart Sierra, Clojure developer
- An opinion. It argues one side of a question engineers disagree on.
Intermediate. Assumes working knowledge.
35K views12 years ago4 recommendations
Software designProgramming languagesSoftware architectureLisp and ClojureFunctional programming
Stuart Sierra introduces the Component pattern and library for Clojure to manage lifecycle and dependencies of stateful services without global state.
Functional programming with immutable values is wonderful, but sooner or later every program has to deal with mutable, stateful, imperative tasks. A large program may need to manage dozens of stateful services: database connections, thread pools, network services, scheduled tasks, and caches. How do we do this in a functional programming model? All too often we fall back, almost by accident, into global mutable state, promiscuous sharing, and imperative spaghetti code. To escape this quagmire, we need to recall some basic principles of both functional and object-oriented programming: referential transparency, immutable values, message-passing, encapsulation, and interface contracts. The Component pattern and its library implementation offer a minimal way to structure the stateful dependencies of a functional program. This talk will cover the motivation for the Component pattern, its benefits and downsides, comparisons with other approaches, and how to use it in Clojure programs. This talk builds on the concepts in last year's "Clojure in the Large" but does not assume viewers have seen that talk first.Why it's here
4 people recommend thisWhat people say. Recommended as a foundational talk on structuring large Clojure applications and managing stateful dependencies.
nilliamson Hacker News • Recommends
On “Spider Programming Language”
nowprovisionon Hacker News • Recommends
On “Your DI framework is killing your code”
jared314on Hacker News • Mentions
On “Introducing .NET Core”
nilliamson Hacker News • Mentions
On “React’s diff algorithm (2013)”