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.

Armour: side-effects-free JavaScript

1 pointsby joeminichinoalmost 10 years ago

1 comment

lollipop25almost 10 years ago
All this does is do a deep copy, which is a costly operation.<p>I suggest using persistent DS libs like immutable.js. You just let that object loose in the code and not worry about side effects happening on the object you are referencing at some point in the code.<p>Sure, they may have the same overhead, but the idea is that your code doesn&#x27;t do unnecessary defensive cloning all over the place. Plus, defensive cloning is an eyesore in code. It isn&#x27;t UI logic, it isn&#x27;t business logic. It&#x27;s just technical debt waiting to happen.