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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Handling errors in IcedCoffeeScript

4 点作者 maxtaco超过 10 年前

1 comment

malgorithms超过 10 年前
I think the great thing about IcedCoffeeScript + the ESC library is how it fits into more complicated flow logic, while allowing easy refactoring. Max doesn&#x27;t really get into the otherwise impossible examples in his post.<p>Even if you&#x27;re firing off RPC&#x27;s awaiting in the middle of a loop or switch statement, you can move logic around just by shifting individual lines. Consider how simple this looks:<p><pre><code> for user_id in user_ids await load_user user_id, esc defer user user.whatever() # etc., with user </code></pre> Writing that in plain Coffee or JS is impossible; using a pure async library is sort of possible but impossible to refactor.