Open jrhorn424 opened 8 years ago
@MicFin Please note this.
Additionally, ask everyone the same question using cold-call cards. Trust me. It sounds silly. Do it.
"What is a callback?"
"A callback is a function that is passed to another function."
This is all. They will think it is a trick. They will think there's more they don't get. It's definitional. Callbacks are not special. They are types passed to a function that accesses those values in the body (invokes the callback in the body). It's just like everything else you can do with a function, whether it's passing a primitive or a reference type.
We'll do a deep dive on asynchrony later.
This indicates that sometimes when we receive vague feedback about "understanding callbacks", some developers do not properly have the vocabulary in their mind. A visual diagramming of an example might help (like diagramming a sentence in English).
For example, when a developer says "the reduce callback" what they typically mean is "the reduce method", but what experienced developers would hear is "the function the reduce method receives as the first argument".
That confusion makes it impossible to explain what a callback is until the more experienced developer recognizes the mistake.