On 6/1/12 3:16 AM, Oliver Leics wrote:
On Fri, Jun 1, 2012 at 7:50 AM, Alan Gutierrez<a...@prettyrobots.com> wrote:
Never confused me. The (err, result) signature means one thing. This means
another. Not very confusing at all. Note: I'm people.
Good for you :) BTW: You are not people, you are you.
I believe you're making a talisman of "consistency", where you're
choosing an arbitrary construct in the text, function signatures of
functions passed to API functions, and turning them into a fetish.
If I can get all the chairs in the office to point in the same
direction, the office will be more organized.
Taking an arbitrary aspect of the API and making it fixed will sew
confusion for people when the fixture does not accurately express the
purpose of the callback.
The purpose of the callback to create a server is to register an event
handler for zero, one or more request events. The purpose of the
callback to `fs.readFile` is to respond to a single event, guaranteed to
occur once and only once.
Adding the error as the first argument to the callback for the server's
request handler forces the server to place a block of error handing code
at the head of the request handling function, when only a subset of the
total set of server errors will occur just prior to executing the event
handler.
What errors actually get passed to this server handler? Can you answer
that question in a way that is less confusing to the venerated newbie
than simply saying, "oh, no, this is different from the callbacks your
learned about in `fs`, error handling is a separate event?"
--
Alan Gutierrez - @bigeasy
--
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en