TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Functional Core, Imperative Shell

4 点作者 dennisy超过 3 年前
I was recently recommended an incredible talk on boundaries by Gary Bernhardt [1], and right away I fell in love with this concept. I then found a further video [2] on this topic and also a HN thread [3].<p>But I need more information on this, I would love to learn more and be able to apply this to my own software, so I was wondering:<p>- Are there example of non trivial apps written in this manner?<p>- Are there more resources which explain the data not code as boundaries concept?<p>- Is there possibly a relevant book?<p>[1] https:&#x2F;&#x2F;www.destroyallsoftware.com&#x2F;talks&#x2F;boundaries<p>[2] https:&#x2F;&#x2F;www.destroyallsoftware.com&#x2F;screencasts&#x2F;catalog&#x2F;functional-core-imperative-shell<p>[3] https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=18043058

1 comment

usrbinbash超过 3 年前
<i>In this screencast we look at one method for crossing this divide. We review a Twitter client whose core is functional: managing tweets, syncing timelines to incoming Twitter API data, remembering cursor positions within the tweet list, and rendering tweets to text for display. This functional core is surrounded by a shell of imperative code: it manipulates stdin, stdout, the database, and the network, all based on values produced by the functional core.</i><p>To me, that sounds how basically every procedural codebase operates: You have an interface, eg. ORM layer &amp; connection handlers to connect a core of functions between which data flows on its way in or out.<p>So yes to all 3 questions as far as I&#x27;m concerned. Almost every program before and after the OOP hype was and is written in this manner.<p>The reason why I think this seems like a new concept to many people, is because the world is still coming down from the aforementioned hype when everything and the kitchen sink was supposed to be an object, and handling things by passing data between freestanding functions was seen as a big nono for some reason.
评论 #29613486 未加载