From: Ted Young <t...@radicaldesigns.org>
Date: Thu, 11 Oct 2012 14:14:10 -0700
Local: Thurs, Oct 11 2012 5:14 pm
Subject: Re: [nodejs] peeves & current best practices?
When in doubt, use callbacks
Basic CI is too easy, there's no excuse not to use it
Ted
On Oct 11, 2012, at 1:36 PM, Adam Crabtree <atcrabt...@gmail.com> wrote:
> It's a best practice because it helps those unfamiliar with the reasoning to keep from shooting themselves or their users in the foot. There are several ways that this may affect you, but a quick summary can be found here:
> http://howtonode.org/understanding-process-next-tick
> How slow is process.nextTick? A quick benchmark reveals it's not just <1ms, but in fact is roughly 1µs (0.001ms for the lazy):
> var i = 0, sum = 0
> That being said, there are always exceptions to the rule, and if you understand the tradeoffs and have a need to shave off µs, then go for it. Chances are though, for the other 99.9% it's a micro-optimization (no pun intended ;P). Again, this requires a special set of circumstances to be an issue, but when it is, discovering that the cause was a cache hit and a synchronous call to callback can be frustrating.
> Cheers,
> On Thu, Oct 11, 2012 at 12:50 PM, Axel Kittenberger <axk...@gmail.com> wrote:
> Ditto!
> We should encourage people to write callers that are good, rather than
> Document your function accordingly, if it guarantees a particular
> Or in other words, cure the problem, not the symptom.
> --
> -- > -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||