Welcome to the Functional Paradigm

Close to the machine, we find ourselves looking at statements and other general commands written via the imperative style. Machine code, C++, and Java are pretty good examples of this.

Imperative Example

It therefore makes sense that the bulk of languages mimic the imperative style; there is an ease of translation that is difficult to achieve otherwise. JavaScript builds upon the aforementioned paradigm but also manages to append functionalism (via the callback).

Callbacks, at least in the context of Javascript, refer to functions that are passed in as an argument. Advantages to callbacks include fewer lines of code and theoretical improved readability. On the other hand, the cost to callback implementation involves dramatically slower speed performances. In spite of this, heuristically speaking, callbacks tend to be quite useful.

Functional Example

Leave a comment