Sunday, 1 March 2015

Object Oriented Programming

Returning from reading week, my group and i began assignment 2. Assignment 2 is mostly all object oriented programming. In my opinion, object oriented programming makes programming a lot more simple.  It's easier to keep things neat, and by creating methods, for objects, yourself helps you understand them and how they work. This also allows something called inheritance, where a class can be a general object, and you can have other objects that are specific instances of it. This helps us in our assignment for many things, such as different games and different computer strategies. For the games, they share some same properties. They have two players, only one can win, one player goes at a time, and a good move for one player is a bad move for the other. Using this, we set up a general class called GameState, however, you need subclasses that are specific games. So each subclass represents a unique game with rules and a different objective to complete. The subclass takes on the general properties of GameState and then is assigned it's own unique properties. This cuts out the work of making two separate classes with a lot of repeated code. A common problem i have is trying to decide what the general code should all have. You must consider what is the same for each subclass, and that is what you will use for the general class. Also, many methods are specific to the subclasses, but in some cases a method in the general class works for both. This again saves you from repeating the same methods in the subclasses. So when a method is not in the subclass, it automatically looks with the general class for the method. I look forward to learning more on object oriented programming.

Sunday, 8 February 2015

At first glance, recursion looks like a difficult concept, however after some practice tracing it, it isn't too hard. A function that calls upon it's self within it's self is an example of the recursion we have done in CSC148. I found this to be quite useful, specially for calculating a sum in a list of lists. If you don't know the size of the list containing many other variable size of lists, and you don't want to have a loop and an if statement to accumulate the sum, you can just use a simple recursive code. One that would add elements together in a list and return the sum.

Sunday, 1 February 2015

So far csc148 has been a great course. The material is more challenging than csc108, and the first assignment required a lot more thinking. Having a harder assignment brought up more difficulties and discussion within the group. We all discussed our own approaches on the assignment and all decided the best, most fitting way to code it in the way to satisfy the class requirements on the assignment sheet. I am looking forward to further assignments where we make more complex games, as well as strategies for the computer to use. So far Professor Heap is a great and very helpful when it comes to answering the questions. The way he teaches make the lectures more fun and enjoyable. I look forward to the rest of csc148.

Sunday, 25 January 2015

First Post!

Many students in computer science do not have a lot of reading or writing assignments. Most of their work is done in front of a computer and it is easy to isolate yourself. However, it is important for geeks to practice their social skills and maintain their reading and writing skills. As a computer science student, i find myself, most often, stumped on an assignment or certain problem. Having interfaces, such as piazza, allows you to communicate with other geeks and enables others to help you with your problems. If i was unable to communicate the problems i was having on a problem i would not have passed csc108. Also, when someone seeks help from you, it helps to practice your knowledge and provide them assistance. This sometimes lets you see the same problem in a different way, and in the end, expanding your own knowledge as well.  A geek must maintain his social skills in order to seek help from others when he is stuck, because it is hard to succeed, in university especially, without a little help.