Recursion, has established a very "troublesome" figure in my head since the first day it was introduced to me. Luckily it was not as I thought it would be initially as I eventually became familiar with this concept later on in the course. I very much liked the idea of the tracing exercise given in class which allowed me to actually developed a liking for this concept.
We were told by our professor that the purpose of recursion is not to make our code run faster nor does it allow code to use up less memory. The purpose of which, surprisingly is to make our code look simple and elegant.(lmao)
I never thought recursion was useful until assignment 2. When me and my teammates were doing the minimax functions we initially wrote our code in the most "expanded" method. Later we decided to try using recursion and substitute all the messy code that we wrote. We were amazed how much better and cleaner our code looked when we used recursion.
Further more, I've found that the tracing practices helped me improve my code tracing skill as well as writing codes. Overall I liked recursion a lot as it helped me improve my programming skill in general.
Monday, 23 February 2015
Thursday, 12 February 2015
Week 6 - Object-Oriented Programming concepts
So far in this course, we become more and more familiar with the concept of Object-Oriented Programming. To my understandings so far,(I might not be 100% correct) that Object-oriented programming (OOP) uses the concept of objects to design and program applications.
In other words, it is a type programming based on programming classes with instance called objects. This brought up a question, what exactly is the definition of an object? An object is a location in memory assigned a value and potentially referenced by an identifier. An object can be a variable, a data structure, or a function. In a class, object can be a combination of variables, functions, and data structures. For example in a class such a employee or perhaps school, the object in which might be the most basic element in the class. Where the salary implemented as an int and the student name implemented as a string would be classified as the objects in particular class.
To me, this is more easily said than done. During assignment 1, often I would create the class and later notice that I've missed certain elements most commonly objects. It is easy to picture the class as a whole yet easily lacking the consideration for the smaller but also important elements.
In other words, it is a type programming based on programming classes with instance called objects. This brought up a question, what exactly is the definition of an object? An object is a location in memory assigned a value and potentially referenced by an identifier. An object can be a variable, a data structure, or a function. In a class, object can be a combination of variables, functions, and data structures. For example in a class such a employee or perhaps school, the object in which might be the most basic element in the class. Where the salary implemented as an int and the student name implemented as a string would be classified as the objects in particular class.
To me, this is more easily said than done. During assignment 1, often I would create the class and later notice that I've missed certain elements most commonly objects. It is easy to picture the class as a whole yet easily lacking the consideration for the smaller but also important elements.
Friday, 6 February 2015
Week 5 slog
As our first term test took place last week we didn't cover much in class. The most recent topic we've covered is recursion. A recursive function is a function that calls itself, and substituting the functionality of loops while looking neat and elegant.
During lectures we worked on exercises tracing recursive functions. I like the idea of this exercise as it helped me developing a deeper understanding for recursion. In the future, hopefully we will have more exercises like this.
I was extremely excited when I was informed that we are allowed a "cheat sheet" during the test. I nearly spend one and half hour gathering information of the course and completing the cheat sheet. During the process of creating this cheat sheet, I found that it feels relatively like reviewing for the course. Interestingly, the second day I barely even looked at the cheat sheet during the test. Everything on my cheat sheet is clearly part of my knowledge and memory, making the cheat sheet was completely useless. I feel like I was well prepared for the test thanks to the cheat sheet. Maybe it's purpose is for us to better prepare rather than "helping" us on the test.
During lectures we worked on exercises tracing recursive functions. I like the idea of this exercise as it helped me developing a deeper understanding for recursion. In the future, hopefully we will have more exercises like this.
I was extremely excited when I was informed that we are allowed a "cheat sheet" during the test. I nearly spend one and half hour gathering information of the course and completing the cheat sheet. During the process of creating this cheat sheet, I found that it feels relatively like reviewing for the course. Interestingly, the second day I barely even looked at the cheat sheet during the test. Everything on my cheat sheet is clearly part of my knowledge and memory, making the cheat sheet was completely useless. I feel like I was well prepared for the test thanks to the cheat sheet. Maybe it's purpose is for us to better prepare rather than "helping" us on the test.
Subscribe to:
Posts (Atom)