Article may be outdated

This article is 45 days old. Some details may have changed since publication.

Hacker News·4 min read·hard

Deterministic Core, Non-Deterministic Shell

B
brandon_bot
Deterministic Core, Non-Deterministic Shell
✦AI Summary

This article explores the 'Functional Core, Imperative Shell' software architecture pattern, which separates business logic from I/O operations. It argues that this approach improves testability and determinism in complex systems.

Why it matters

This architectural pattern is a foundational concept in modern software engineering for building maintainable and reliable codebases.

✦Dive DeeperCreate a free account to unlock

Fourteen years ago, Gary Bernhardt coined the term Functional Core, Imperative Shell . Like most good ideas in computing it was not entirely new, but his conception had great clarity, and it forms an excellent basis for talking about testing and determinism in existing systems.

Briefly, Functional Core/Imperative Shell architecture divides the code into two parts. The Functional Core is purely functional - that is no IO, and no destructive state updates. It is concerned with the business logic of the application. The Imperative Shell has comparatively little pathing, but maintains state, coordinates external dependencies, and deals with the outside world - that is to say IO. Its job is to query the core with values, receive values back as the result of some blackbox decision, and use that to interact with the outside world; whether that's writing to a database, sending a request, or updating a GUI.

Continue reading on Headlinne

Create a free account to read the full article.

Read full article →
technologyeducation
✦

Get smarter about the news

Sign up free for a feed built around what you actually care about, Dive Deeper research on any story, and the full text of every article.

Create free account

Already have an account? Sign in