January 2020
Intermediate to advanced
532 pages
13h 31m
English
Since the logical flow is quite linear, how do we deal with conditional logic?
Suppose we want to determine the hotness of top stories by checking the average score against a threshold. If the average score is higher than 100, then it would be considered high; otherwise, it would be considered low. So, literally, we need an if-statement that determines what to execute next.
We can use dynamic dispatch to solve this problem. We are going to build this function from the bottom-up, as follows.
Read now
Unlock full access