Same with us. 2 years, no problems even though Zalgo is released all over
the place with error checking code.
I think we get avoid any problems by just assuming that any callbacks could
be called synchronously.
That means never doing something that seems dirty like this:
var thing = doThing(function() {
thing.doSomething(); // wtf? why should I have to reason about whether
this is valid here or not, just assume it is NOT
});
doThing(function(err, thing){
thing.doSomething(); // never will have any issues reasoning about
whether it was called async or sync because the callback has the stuff we
need
});
Anyway. My personal opinion is that people are making a bigger deal about
it than it needs to be. Just be aware that there could maybe potentially be
an issue in your app if you release Zalgo, but don't spend the hours going
through and wrapping everything in nextTick just to say you are Zalgo-free
even if Zalgo being released has ever doomed you.
On Friday, August 30, 2013 11:02:01 AM UTC-4, Bryan Donovan wrote:
>
>
> On Aug 29, 2013, at 7:09 PM, Isaac Schlueter <[email protected] <javascript:>>
> wrote:
>
> > On Thu, Aug 29, 2013 at 11:19 AM, Bryan Donovan
> > <[email protected]<javascript:>>
> wrote:
> >> Thanks, I just wanted to make sure my understanding was correct in that
> >> there really is no problem with the specific case I presented.
> >
> > That understanding is incorrect.
> >
> > The exact problem being described in Havoc's post and in mine, is a
> > problem with the specific case you presented.
>
> I do understand how it's inconsistent, and I see how it *could* be a
> problem, but I still haven't seen an example of how my example would cause
> a real problem in a real application. Let's pretend it's not a public npm
> for a minute and this 'db' is a home-grown internal module. Say I'm on a
> team with 10 developers, all working on a REST API using this module. Is
> there a scenario that would cause a problem in this app due to immediately
> calling back?
>
> I'm trying to figure out whether it's worth it to go back and change every
> place in our app that does an immediate callback.
>
> Given that I haven't seen any issues with this in two years, I doubt it's
> really an issue (again, for an internal app, not a public library). But
> maybe there are issues we just haven't noticed.
>
>
> >
> > Throw now, or nextTick the callback. Don't do it half-way.
> >
> > On Thu, Aug 29, 2013 at 7:04 PM, Isaac Schlueter <[email protected]<javascript:>>
> wrote:
> >> if (!args.index) { next(new Error('index required')); }
> >> if (!args.type) { next(new Error('type required')); }
> >
> > Ugh, a bug in my example. It should be `return next(new Error(...))`,
> > so that it doesn't try to do the async thing if it's already called
> > the cb with an error.
> >
> > --
> > --
> > Job Board: http://jobs.nodejs.org/
> > Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> > You received this message because you are subscribed to the Google
> > Groups "nodejs" group.
> > To post to this group, send email to [email protected]<javascript:>
> > To unsubscribe from this group, send email to
> > [email protected] <javascript:>
> > For more options, visit this group at
> > http://groups.google.com/group/nodejs?hl=en?hl=en
> >
> > ---
> > You received this message because you are subscribed to a topic in the
> Google Groups "nodejs" group.
> > To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/nodejs/0TmVfX9z1R0/unsubscribe.
> > To unsubscribe from this group and all its topics, send an email to
> [email protected] <javascript:>.
> > For more options, visit https://groups.google.com/groups/opt_out.
>
>
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.