Sunday, 13 October 2013

Object oriented programming and Recursion

When I learned C programming in 1st year of university I noticed it was very difficult to manage a large number of variables and passing them to different functions. This problem is perfectly solved by object oriented programming. By having object oriented programming, each object have certain attributes which can store specific info. In addition, methods of objects are pretty much like functions, but they are perfectly incorporated into objects. Each object does its own thing while working with other objects. It resembles organs in human bodies. While doing its own tasks, it also connects with other organs. A great creation it is.

The way I see recursion is it's like the mathematics. To utilize this powerful tool, you need to be able to work your math through. By interpreting problems mathematically, you can relates variables in a certain fashion. Also you need to come up with base cases. And then you just need to implement your logic in your code to let the computer figure out the solution for you. Great!!!

1 comment:

  1. I guess my issue is that I'm used to languages like Python and Java that really push the object oriented concept. They're built specifically for that, while C is much more loose and from what I understand has a much different set of principles and practices that I'm kind of confused on. I'm interested in writing C the right way, which to my understanding isn't really object oriented.

    ReplyDelete