To be honest, I have taken this computer science course just for a compulsory for my math specialist. In high school, I have never tried programming before and it was a new world to me! After these weeks of coding, designing, and thinking like a computer scientist, I would say that I really appreciate myself on how much time I have put into this course!
As a reflection on the recursion topic I have discussed earlier, recursion has became one of the topic I was really looking forward to think more function that can work with it! I love the feeling when I found out that I got the right recursion function and it all worked out!
We know that in Python, a function can call other functions. It is even possible for the function to call itself. These type of construct are termed as recursive functions. There are three main advantages of recursion that I found really helpful while I was working on my assignments, the thinking on recursion method provokes me to consider other functions which can work as well. So I have came up with 3 advantages and 3 disadvantages:
Advantages:
1) Recursive functions make the code look clean and elegant
2) A complex task can be broken down into simpler sub-problems using recursion
3) Sequence generation is easier with recursion than using some nested iteration
Disadvantages:
1) Sometimes the logic behind recursion is hard to follow through
2) recursive calls are expensive and inefficient as they take up a lot of memory and time
3) Recursive functions are hard to debug