This wasn’t cool. Documentation should not take conventions for granted.
The Crux: Error-First Callbacks
- If the last parameter of a method is a function, that parameter is used to track async execution of code. Calling that function means “async execution has completed.”
- When you have a callback function like this, it takes two parameters.
- The first parameter is any errors that occurred.
- The second parameter is any success object.
Pay attention to conventions. Document them.
- “Convention over Configuration” by John Otander
- “The Node.js Way – Understanding Error-First Callbacks” by Fred K. Schott
- “The Myth of Convention Over Configuration” by Giles Bowkett