• Treating functions as objects, storing them in lists, assigning them to variables, and calling them through those
variables.
• Building dynamic functions with lambda.
• Building closures, dynamic functions that contain surrounding variables as constants.
• Building generators, resumable functions that perform incremental logic and return different values each time
you call them.
Adding abstractions, building functions dynamically, building closures, and using generators can all make your code
simpler, more readable, and more flexible. But they can also end up making it more difficult to debug later. It's up to
you to find the right balance between simplicity and power.
variables.
• Building dynamic functions with lambda.
• Building closures, dynamic functions that contain surrounding variables as constants.
• Building generators, resumable functions that perform incremental logic and return different values each time
you call them.
Adding abstractions, building functions dynamically, building closures, and using generators can all make your code
simpler, more readable, and more flexible. But they can also end up making it more difficult to debug later. It's up to
you to find the right balance between simplicity and power.
Comments
Post a Comment
https://gengwg.blogspot.com/