Monday, 7 October 2013

so apparently this was supposed to be a weekly thing, but i didn't actually read it until today.

 so our group finished part 1 through 3. part 3 was particularly infuriating as i forgot to update x and y coords for the moved cheese, so the cheese would move back to the original stack and i would get mad. but otherwise the assignment was quite straight forward. as long as the logic was reasoned out the code fell into place nicely.

RECURSION
the concept is simple, just actually coding it is a big pain and takes longer than one would expect. in recursion, not only do you run the risk of having not working code, if coded improperly a recursive method wont be able to find its terminating case, thus causing a dreaded infinite loop. the problem might lie in having a method inside rather than outside an if statement, or an x value not going to 0, but regardless i find troubleshooting recursion to be a little bit more tricky than regular non-recursive code as you need to theoretically run it in your head. overall this is useful for us computer scientists because in the long run recursion uses less memory and is more efficient.

OOP
Object Oriented Programming is a godsend. I dont know where i'd be without OOP. OOP is like methods. once you learn how to code methods, you never go back. its so great. OOP allows for custom data types (classes) and stores variables associated with them. so instead of having 300 x and 300 y values to track, you can track 300 Cheeses instead and pull each unique x and y coordinate. this is a must for computer scientists because of its efficiency and ability to optimally code things not hard coded into the programming language.

No comments:

Post a Comment