On Wed, Aug 8, 2012 at 4:13 AM, Dan Milon <
danm...@gmail.com> wrote:
> That will work, indeed, but it annoys me that indentation and code
> readability gets fucked up. You have to follow code traces in order to
> understand the ordering of execution.
Dan, you're not going to get any less indentation than my simple
example. There has to be at least one level of indentation after your
callback no matter what unless you extend the language.
If it makes you feel better you can indent your conditional in one
level as well so that they are both one level deep.
What I was showing is that function statements hoist their value, so
you can call them before the line that defines them is executed. This
means your program can execute in a top-down linear fashion without
ever nesting any more than one level deep for callbacks.
As far as what the async library provides, I have no idea, I've never
used it. It will require at least one function block with a level
of indentation though.
I find using named functions and other clever uses of the language
itself provides just as clear code most the time and with a lot less
abstraction.