TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Handling errors in IcedCoffeeScript

4 pointsby maxtacoover 10 years ago

1 comment

malgorithmsover 10 years ago
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.