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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Maybe We Should Keep Our Promises

1 点作者 rmoskal超过 7 年前

1 comment

the_hoser超过 7 年前
Maybe you shouldn&#x27;t link to the edit URL for your posts.<p>But on the topic, your example relies too much on pokemon code. What if you have multiple exceptions at different stage of your pipeline? What if two stages can produce the same exception type, and it&#x27;s important to know which one produced it? What if you need to roll back in the event of an exception, and <i>where</i> the exception took place is important to doing this?<p>With imperative code, this is tricky. With function composition as presented in your post, it&#x27;s a nightmare.<p>The imperative code may not be as elegant as the &#x27;functional&#x27; solution, but in the long run, it&#x27;s easier to maintain.
评论 #16214455 未加载