Рет қаралды 405
There are a few ways to return values from functions, with the two main ones being:
1) Directly as a return value
2) through a callback that
While both have their times and places to be used, they shouldn’t be used together in the same function as it creates a confusing interface.
Today we’ll look at some confusing examples where they are used together, and see how things can be made cleaner.
While today’s examples are in Python, the ideas discussed can apply to most languages.
The outro music is:
Funk Game Loop by Kevin MacLeod is licensed under a Creative Commons Attribution 4.0 license. creativecommons.org/licenses/...
Source: incompetech.com/music/royalty-...
Artist: incompetech.com/
00:00 Introduction
01:35 Example 1
09:08 Example 2
14:01 Wrap up