python-novice-inflammation icon indicating copy to clipboard operation
python-novice-inflammation copied to clipboard

Suggestion for lesson 8: Add example of a case where duplication is avoided using functions

Open apirogov opened this issue 4 years ago • 1 comments

The lesson starts with an "abstract" discussion on why one might want to define own functions.

Maybe it would be good to actually demonstrate these problems? I'm just not sure what would be not too artificial and not too complicated, and take not too much time of the lesson just for illustrating the motivation for using functions.

Maybe something like: have the fahrenheit-to-celsius formula used twice, using copy-pasing, and with a little mistake. Then it is immediately clear how it would be nice to change the formula only in one place instead of looking for all wrong copies and fixing them.

apirogov avatar Sep 10 '21 08:09 apirogov

Hi @apirogov , Thank you for taking the time to submit feedback about the lesson. Regarding the "abstract" discussion on why we might define our own functions, do you think the reasoning currently given is unclear? I agree that if a demonstration of a problem is added, it should be not too artificial, complicated, or long. However, if it is needed to make the need for defining functions more clear, pull requests suggesting changes are welcome.

ldko avatar Oct 04 '21 20:10 ldko