Sunday, 15 March 2015
Sunday, 8 March 2015
Monday, 2 March 2015
Object Oriented Programming summary!
(for evaluator,
I chose my previous slog entry as worth of evaluation, therefor I will copy the contents from the entry into this one.)
I believe that object oriented programming will be one of the more useful tools in my tool belt moving forward in my computer science career. One aspect of object oriented programming which I Found to be immensely useful was the concept of inheritance. In order for me to fully understand the mechanisms behind inheritance I looked at many examples classes and sub-classes in a python visualizer and traced the intricacies of inheritance. one such example is pictured below and was taken from the lecture slides.
In this example the output will be:
a.f(1): 1
b.f(1): 2
At first it was hard to understand why the output was as such but when looking through the visualizer I realized that a call to print b.f(1) would first go to the method 'f' in the class 'A' which would then call for method 'g' in the subclass. From this is became easier to understand that python will first look for the method in the subclass before it starts looking for the method in the superclass. Once this confusion was cleared up it became quite simple to trace programs which make use of inheritance.
Another aspect of object oriented programming I found to be important was its ability to easily make use of abstract data types. Integrating object oriented programming with ADTs is extremely flexible, case in point being the assignments we are completing within CSC148. In these assignments we are able to make a wide range of games with even limited tools. In assignment 2 we are expected to create a game of Tippy, which is a tic-tac-toe variant, and in addition to creating the game we must also employ a strong strategy for the computer's choice of move. The flexibility of classes make it such that setting up the game board and integrating strategies can all be done inside the classes! Classes can hold many different types of objects making them a very powerful tool when trying to tackle problems which require a wide range of tools.
going forward, under the umbrella of object oriented programming, there will be a more in depth analysis on recursion and its various applications. Integrating the recursive processes with my current knowledge of object oriented programming I hope will lead to many fun and fruitful results.
I chose my previous slog entry as worth of evaluation, therefor I will copy the contents from the entry into this one.)
I believe that object oriented programming will be one of the more useful tools in my tool belt moving forward in my computer science career. One aspect of object oriented programming which I Found to be immensely useful was the concept of inheritance. In order for me to fully understand the mechanisms behind inheritance I looked at many examples classes and sub-classes in a python visualizer and traced the intricacies of inheritance. one such example is pictured below and was taken from the lecture slides.
In this example the output will be:
a.f(1): 1
b.f(1): 2
At first it was hard to understand why the output was as such but when looking through the visualizer I realized that a call to print b.f(1) would first go to the method 'f' in the class 'A' which would then call for method 'g' in the subclass. From this is became easier to understand that python will first look for the method in the subclass before it starts looking for the method in the superclass. Once this confusion was cleared up it became quite simple to trace programs which make use of inheritance.
Another aspect of object oriented programming I found to be important was its ability to easily make use of abstract data types. Integrating object oriented programming with ADTs is extremely flexible, case in point being the assignments we are completing within CSC148. In these assignments we are able to make a wide range of games with even limited tools. In assignment 2 we are expected to create a game of Tippy, which is a tic-tac-toe variant, and in addition to creating the game we must also employ a strong strategy for the computer's choice of move. The flexibility of classes make it such that setting up the game board and integrating strategies can all be done inside the classes! Classes can hold many different types of objects making them a very powerful tool when trying to tackle problems which require a wide range of tools.
going forward, under the umbrella of object oriented programming, there will be a more in depth analysis on recursion and its various applications. Integrating the recursive processes with my current knowledge of object oriented programming I hope will lead to many fun and fruitful results.
Sunday, 15 February 2015
Object oriented Programming!
I believe that object oriented programming will be one of the more useful tools in my tool belt moving forward in my computer science career. One aspect of object oriented programming which I Found to be immensely useful was the concept of inheritance. In order for me to fully understand the mechanisms behind inheritance I looked at many examples classes and sub-classes in a python visualizer and traced the intricacies of inheritance. one such example is pictured below and was taken from the lecture slides.
In this example the output will be:
a.f(1): 1
b.f(1): 2
At first it was hard to understand why the output was as such but when looking through the visualizer I realized that a call to print b.f(1) would first go to the method 'f' in the class 'A' which would then call for method 'g' in the subclass. From this is became easier to understand that python will first look for the method in the subclass before it starts looking for the method in the superclass. Once this confusion was cleared up it became quite simple to trace programs which make use of inheritance.
Another aspect of object oriented programming I found to be important was its ability to easily make use of abstract data types. Integrating object oriented programming with ADTs is extremely flexible, case in point being the assignments we are completing within CSC148. In these assignments we are able to make a wide range of games with even limited tools. In assignment 2 we are expected to create a game of Tippy, which is a tic-tac-toe variant, and in addition to creating the game we must also employ a strong strategy for the computer's choice of move. The flexibility of classes make it such that setting up the game board and integrating strategies can all be done inside the classes! Classes can hold many different types of objects making them a very powerful tool when trying to tackle problems which require a wide range of tools.
going forward, under the umbrella of object oriented programming, there will be a more in depth analysis on recursion and its various applications. Integrating the recursive processes with my current knowledge of object oriented programming I hope will lead to many fun and fruitful results.
In this example the output will be:
a.f(1): 1
b.f(1): 2
At first it was hard to understand why the output was as such but when looking through the visualizer I realized that a call to print b.f(1) would first go to the method 'f' in the class 'A' which would then call for method 'g' in the subclass. From this is became easier to understand that python will first look for the method in the subclass before it starts looking for the method in the superclass. Once this confusion was cleared up it became quite simple to trace programs which make use of inheritance.
Another aspect of object oriented programming I found to be important was its ability to easily make use of abstract data types. Integrating object oriented programming with ADTs is extremely flexible, case in point being the assignments we are completing within CSC148. In these assignments we are able to make a wide range of games with even limited tools. In assignment 2 we are expected to create a game of Tippy, which is a tic-tac-toe variant, and in addition to creating the game we must also employ a strong strategy for the computer's choice of move. The flexibility of classes make it such that setting up the game board and integrating strategies can all be done inside the classes! Classes can hold many different types of objects making them a very powerful tool when trying to tackle problems which require a wide range of tools.
going forward, under the umbrella of object oriented programming, there will be a more in depth analysis on recursion and its various applications. Integrating the recursive processes with my current knowledge of object oriented programming I hope will lead to many fun and fruitful results.
Sunday, 8 February 2015
Tracing recursion
Tracing recursion is fairly easy until abstract data types get involved. Working with basic examples of recursion seem very fun and easy, however when tracing recursion examples for items on a stack I found that the tracing became much more difficult. At first I was quite confused with the output I was recieving, I spent a great deal of time trying to trace over the function and figure out what was happening. Eventually I decided to cheat a little and add a few print statements within the code to check how the stack was being updated every time it was fed back into the recursive code. Although I eventually was able to understand the code I still feel like I need more practice before I can be confident in my tracing abilities.
In order to improve my tracing ability I plan on working through as many examples as I can. Looking at examples in the course notes will be very beneficial. Another way in which I could improve would be to create many examples of recursive code. I feel that I would understand the recursive process more if I was writing out the code line by line myself. The more exposed i am to recursion the more likely I will be to understand it, therefor in future assingments I will try to incorporate it in as many processes as I can
Sunday, 1 February 2015
Frightful First Few Weeks.
The first few weeks in the course CSC148 have come as much of a surprise. After finishing CSC108 during the 2014 Fall session and receiving a better than average grade I came into CSC148 with high hopes, and a high-level of hubris. I soon did realize the magnitude of my gross underestimation when the first quiz was in front of me. I instantly became aware of how little I knew about classes. Although it was a simple quiz, being only a single question, I spent a lot of time trying to figure out what the question would be looking for. Needless to say, I didn't get the desired marks on my first quiz. I had learned my lesson and went home directly to read over all the course notes and lecture slides twice over. Professor heap stated that during the first year of computer science studies the teaching staff want to instill the virtue of 'laziness' in the students, although I understand what is meant by this I also know that computer science isn't a field of study that allows people to cut corners. For example, if a person skipped the earlier lectures in this course they wouldn't have a firm grasp on the implementation of list comprehensions. That person would have just lost a major problem solving tool. It is for that reason I should not underestimate CSC148 as being "just another 100-level course" because everything learned in these "basic" courses will benefit me in the future, if not immediately.
Another impression I had of the first few weeks is that the course material isn't as straight forward as it was in CSC108. I understand how this freedom will be a common theme within a work place environment, because employers won't "hold the hands" of their new employees for too long so it is important to be have a good sense of direction and plan ahead when possible. The first assignment for example, did not have any set format like assignments in CSC108. No specific methods were required which meant more freedom for students. This increase in freedom came as a double-edged sword because although we were allowed to experiment a little bit with our methods we would still have to make use of 5 classes in order to receive full marks, some of which I did understand how to incorporate/populate (I didn't know what kind of methods to put inside game_view and whether or not they belonged there). It would be very easy to create a working game of subtract square without the overly complicated use of classes and inheritance but one of the main purposes of this assignment was to create a framework in which any two-player/turn-based/zero-sum/full-disclosure game could be plugged in to play in the future. So for that reason I believe that, overall, the first assignment was a good learning experience in the skills of self-organization and planning. In conclusion, CSC148 operates at a much faster pace when compared to CSC108 and therefor I should not face it with the same attitude and I should definitely not underestimate this course going forward.
Another impression I had of the first few weeks is that the course material isn't as straight forward as it was in CSC108. I understand how this freedom will be a common theme within a work place environment, because employers won't "hold the hands" of their new employees for too long so it is important to be have a good sense of direction and plan ahead when possible. The first assignment for example, did not have any set format like assignments in CSC108. No specific methods were required which meant more freedom for students. This increase in freedom came as a double-edged sword because although we were allowed to experiment a little bit with our methods we would still have to make use of 5 classes in order to receive full marks, some of which I did understand how to incorporate/populate (I didn't know what kind of methods to put inside game_view and whether or not they belonged there). It would be very easy to create a working game of subtract square without the overly complicated use of classes and inheritance but one of the main purposes of this assignment was to create a framework in which any two-player/turn-based/zero-sum/full-disclosure game could be plugged in to play in the future. So for that reason I believe that, overall, the first assignment was a good learning experience in the skills of self-organization and planning. In conclusion, CSC148 operates at a much faster pace when compared to CSC108 and therefor I should not face it with the same attitude and I should definitely not underestimate this course going forward.
Sunday, 25 January 2015
Why Geeks Should Know How to Write.
Geeks should know how to write because communication is a key tool in a business environment. For example, in CSC108 we learned how to write out structured docstrings. These docstrings will prove to be very useful when a peer in the workplace wants to learn more about your program. In addition, the use of comments within code also aids peers as they navigate the inner workings of your code. The need for communication has already been highlighted by group assignments, within which a great amount of time is spent sharing ideas and working together on a communal program file. When a computer scientist enters the job market the possession of great communication skills, especially those concerning text based communication, are looked very highly upon by employers. Due to the abstract nature of their work, computer scientists need to be able to effectively communicate their ideas with their peers to make sure everyone is on the same page when working to complete a project.
Geeks also need to know how to write because a clear and comfortably-used program is highly important to a user. In today's society it is important to make technologies easily understandable and user-friendly, the use of textual communication plays a key part in simplifying a user-interface. Many programs have some sort of "help" page in order to instruct the user on how to operate the program. The instructions on this help page need to be exceptionally clear or else the burden on the user will increase, therefor it is necessary for the "Geek" that is writing the help page to be able to clearly define all important aspects of the program as well as how to navigate through the user-interface. lowering the burden on the user is great way of ensuring a program is used properly and comfortably, a geek should know how to write for this purpose.
Geeks also need to know how to write because a clear and comfortably-used program is highly important to a user. In today's society it is important to make technologies easily understandable and user-friendly, the use of textual communication plays a key part in simplifying a user-interface. Many programs have some sort of "help" page in order to instruct the user on how to operate the program. The instructions on this help page need to be exceptionally clear or else the burden on the user will increase, therefor it is necessary for the "Geek" that is writing the help page to be able to clearly define all important aspects of the program as well as how to navigate through the user-interface. lowering the burden on the user is great way of ensuring a program is used properly and comfortably, a geek should know how to write for this purpose.
Subscribe to:
Comments (Atom)
