Monday, 14 October 2013

Object-oriented programming and recursion

       One thing we have studied recently in csc148 is Object-oriented programming. Object-oriented programming is a programming paradigm that makes the functionality and data together into an object, and python is an object-oriented programming language. The object-oriented programming in python   consists of two parts , class and methods , the class is a user-defined prototype for an object that defines a set of attributes, and the method is a  kind of function  defined in the class. The class has an __int__ (initialize) method which is used to set up attributes and  new instances . I think  Object-oriented programming provides a very clear modular structure , and easy to modify when there is only a slight change to the existing code , overall , it's clear structured and intelligible. 
      I consider recursion as the hardest thing I learn in this course. To use recursion , we should divide the problem into some sub problems , and solving the problems by calling the sub problems. The recursion really makes some complex questions easier , and it's really hard to come up with the idea in the first place . By the way , the recursion requires a case outside it to make itself finite. 

No comments:

Post a Comment