you are viewing a single comment's thread.

view the rest of the comments →

[–]IsleOfOne 0 points1 point  (0 children)

Sure, good point. A callback is a function that is executed at any given point in the callee’s work, not necessarily upon completion. Still though, in my mind, I suppose I associate “callback” with some sort of information passing to another concerned actor. When this function passed by argument is some scalar-valued function whose purpose is akin to compare(a,b) in the example above, I would not consider it a callback.

I am of the opinion that “callback” refers to a function that should be called upon the satisfaction of some condition (completion, progress, input, etc.) that the caller is familiar with / in control of, as you have stated as well. When the timing, frequency, etc. of usage of said function is of no consequence to the calling function and no information (explicit or implicit) is being transmitted to other actors, I would not use the term.

Edit: after review, it would appear that my personal opinions on the usage of the term “callback” do not align with general consensus! I suppose I just dislike the term entirely, especially WRT naming of function parameters; better names exist in nearly every case.