Object Oriented Programming
I read about Object Oriented Programming from the week 1's required materials. I read from openbookproject.net that, "It was developed as a way to handle the rapidly increasing size and complexity of software systems, and to make it easier to modify these large and complex systems over time". Object Oriented programming's focus is on the creation of objects, which contain both data and functionality together. (I'm still confused about the idea of objects, what it really means, and... it seems just a bit ambiguous to me right now). Stated on the same website says, "Usually, each object definition corresponds to some object or concept in the real
world, and the functions that operate on that object correspond to the ways
real-world objects interact.", I thought about this sentence, and got me to ask myself..hmm what kind of real-world object interactions would represent the for or while loop.. and actually put my mind into a while loop that couldn't be solved..
Recursion
Recursion. I heard many of my friends in the upper years in programming say that it is the beauty, the blossoming flower of programming for some reason.. I didn't know what they were talking about back when I was in csc108, but, when I saw how it can be used to put a repetition to an end, and put in into few lines of code, I realized why they said that. For me at the moment, recursion does not come easy. Actually, it is pretty hard. I know how to go about doing things in the looping way, but than converting the loops and repetitions into a recursive method doesn't come automatically to me right now. A function inside a function, I don't know if I lack brain power, but I have to write everything down draw it, or look using the visualizer to understand every piece of my code when using recursion. (but, the visualizer, is really hard to work with when doing recursions..).
Clearly, I think I need a lot of practice doing recursions.
Also, some say that recursion is less efficient than using iteration in forms of for and while loops. But when I asked the professor, he commented that, it is in the old days, when computers were not powerful enough, but nowadays, using recursion is a much more efficient method to coding.
No comments:
Post a Comment