|
|
|
|
|
by mjw1007
2644 days ago
|
|
One common case where this is attractive is where you have a bunch of "public" functions built on top of each other, with the higher ones passing that parameter on and not otherwise caring what it is: high_level_function(src, ...)
...
mid_level_function(src, ...)
...
mid_level_function(src, ...)
low_level_function(src, ...)
...
low_level_function(src, ...)
...
If you can make the low-level function generic one way or another, you avoid having to duplicate the higher-level functions.Another case is where there are two or more parameters that you want to be generic in this sense: if your only option is duplicating the function you can end up having to define inconveniently many variants. |
|