2013年10月9日星期三

Opinions about Object-Oriented Programming and Recursion

  Object-Oriented Programming is also known as the OOP, it is quite different than the traditional procedural programming that it focus mainly on creating class and each class is combined of data and our defined functions. It allows us by adding attributes and methods of our own interests and can directly call on that object and only be accessed by that object class. There are slightly more works than just defining functions, however it truly keeps the solution neat and clean.
 
    Recursion, "defining something in terms of itself" according to what the online book How To Think Like A Computer Scientist: Learning With Python 3 states. To me, recursion works a little big similar to inheritance, that many things can be created through itself, to be a little bit more clear that is it bares similar process as for loop but usually recursion has a smaller scale. Also, without going through hassle, recursion allows a function to call on itself when a subproblem is encounter thus solving the subproblem. It is convenient and sometimes time efficient, as recursion gives the same answer but in a shorter expression.


没有评论:

发表评论