Friday, January 30, 2015

First Impressions (Weeks 1-3)

In the first 3 weeks of the course, I learnt a lot of new things. We looked at abstract data types (ADTs): stack, which stores items and allows users to remove the top item or add a new item to the top of the stack, and provides a way to tell whether the stack is empty; queue, which stores items and allows users to remove the item that was put into the queue first (the beginning of the queue) or add a new item at the end of the queue, and like stack, also provides a way to tell whether the queue is empty or not. I can see how ADTs can be extremely useful when trying to solve certain problems, and I am hoping that we can have some fun and get an opportunity to play around with them.

We reviewed the basics of how to define a class, which I had learned in CSC108 last term, then we were introduced to a few new things:

  • The property mechanism, which is used to re-direct access to an attribute in a class so that it must use a method. If your code is being used by other people/clients, making changes to your code can be troublesome for them, so the property mechanism will come in handy. 
  • Inheritance, which allows us to create new classes that add a few features to an existing class, but still represent the same sort of thing. This featured in our first assignment in this course. 
Another thing that we learned was how to deal with exceptions. During CSC108 last term, I had noticed that a lot of the functions I was writing did not account for all the circumstances involved, and nobody ever mentioned anything wrong with that, which bothered me a lot. Finding out that there is a way of dealing with exceptions is really satisfying, because I can now see how I could go back and fix a lot of the things that had bothered me during CSC108. 

All the new things we are learning so far seem fairly straight forward, but from assignment 1, I realized that CSC148 is a lot more challenging than CSC108 was. We were not provided any base code, so we had to start from scratch and plan out the entire program ourselves. I found this really overwhelming, and had a lot of difficulty figuring it out, but once I had a plan set in place, I managed to get it done bit by bit. Looking back at the work I did for assignment 1 amazes me and makes me feel really accomplished because the fact that all these lines of code that I had written actually worked properly makes me feel like I am making progress and improving. 

Overall, CSC148 has been really enjoyable so far, and I am looking forward to learning more. 

Tuesday, January 20, 2015

Why Geeks Write

I took CSC165 last term in which a SLOG was also required. Back then, I found SLOGs to be a waste of time because I thought it was just a way for the professors to get an idea of how students were doing in their classes. So when I found that we had to write a SLOG for CSC148 as well, I was a little annoyed. However, this course differs from CSC165 in that there are actually set topics to write about for some weeks.

This week we were told to write about why computer scientists need to know how to write. This really got me thinking, and after looking at the blogs provided on the course website, (these two in particular: http://steverydz.com/2013/11/19/keeping-a-debugging-journal/ and http://www.joelonsoftware.com/articles/CollegeAdvice.html) I started to realize how a SLOG is so much more than just a way for professors to stalk the progress of students. It is a way to document thought processes when solving problems, so if you encounter similar problems in the future, you can easily look back and use what you've written down to help you. 

Writing is a useful skill for a computer scientist to have because if you want to write well, you have to be able to organize the content so that it is clear and understandable. Clear documentation will allow us to more easily debug our work and allow users of our code to understand what our code does without too much effort. It also gives yourself a chance to clarify thoughts or concepts in your own head that you may not have been entirely confident with before. In CSC108, I picked up a useful trick - if you cannot figure out how to write the code straight way, try writing out what you want the code to do in English first. It will become more clear to you how to write the code. 

So all of this being said, I have learnt my lesson and I plan on putting more effort into my SLOG for this course than I did for CSC165.