Monday, April 6, 2015

Week 12: Last Impressions

Alas the term has finally come to an end. This also means that this post will be my last, and in it I hope to reflect upon the whole course from start to finish, considering the different challenges and triumphs I encountered.

Unlike CSC108, this course is not really a programming course. Even though we dealt with coding for the bulk of the course, our main focus was on understanding concepts such as Object Oriented Programming, Abstract Data Types, Recursion, Big-Oh and efficiency. We may have learned these concepts using Python, but we could have easily done so with any other object-oriented programming language.

Through the course of the term, I didn't really enjoy going to lectures because I didn't have a laptop. I was more thrilled to go to lab meetings where I could work with the code hands-on. Topics that stood out for me were the concepts of Inheritance and Recursion, although I have to say that I enjoyed doing the recursion exercises the most. Doing the lab work really helped me in absorbing the concepts, compared to just looking at lecture slides. 

I relied on my labs when tackling assignments and term tests. In preparing for tests, I spent most of my time going back through them instead of studying my notes. This is why it really sucked when labs got cancelled because of the strike. I know other students relied on labs too to understand lectures better. 

At the end of the day, even with the four week strike, we managed to finish the course! So yay! It was an interesting journey from day one to last, and I hope to learn more in the years to come!

Sunday, March 29, 2015

Week 11: Revisiting an Earlier SLOG Post

I want to revisit my Week 5 post which is about recursion. First of all, I just want to say that I can't believe that the term is almost over and Week 5 seems like a long long time ago. I remember how we took it very slow at first, just tracing recursion on paper before even writing any code. And when we did write code, Professor Heap guided us step by step through the exercises. Because of all this, I now feel more comfortable reading and writing recursive code than I was back then. 

Furthermore, all the extra exercises and lab work I've done then since then has really proved to me the importance of establishing the base case of recursive code. As I read through this slogger's post, I found that we kind of tackle problems in the same way. We feel more comfortable in writing recursive code once we're confident that the function handles the base case correctly.We also try to break down complex problems into smaller pieces by implementing helper functions. I've done this in my Assignments and I find it very helpful especially when debugging code.

Overall, I guess I would have to say that I agree with my earlier post. The difference now is that I've seen more applications of recursion, so I can appreciate it even more. 

Sunday, March 22, 2015

Week 10: Impressions of Week 9

We did not really have much lecture time for week 9 as Term Test 2 occurred during this week. Professor Heap mainly talked more about the Binary Search Tree and its insert and delete method. Deleting a node was a bit more complicated because we had to think about what should happen with the tree depending on whether or not the node had a right child, a left child or both children. This needed to be given some thought in order to preserve the BST condition after deleting a certain node. 

On Wednesday, Term Test 2 proceeded normally even with the strike still going on. Although, I do wish we had our labs back because it's a bit confusing to do the lab exercises without the TA. I think it's been three weeks now since the strike began and I hope it ends soon. 

Saturday, March 14, 2015

Week 9: Impressions of Week 8

When considering to use a certain data structure, we consider its properties and evaluate whether or not it fits our needs. For example, I think of the Binary Search Tree when I think of sorting integers because of its efficiency. I can see its advantages over the list data structure. However, I'm not quite sure when to use Linked Lists. I don't think we've discussed its applications or advantages in class yet. This is something I would like to know more about.

On another note, assignment 2 was also due on week 8. It was definitely more complicated than the first assignment. My partner and I decided to implement the Minimax algorithm first and test it on Subtract Square. Only after finishing that did we move on to implementing the game Tippy. When we finally completed the game, we played a 3x3 board with a computer running Minimax. It always won whenever it made the first move! I felt ecstatic! I was never so happy to lose! It meant the code worked!    

Thursday, March 5, 2015

Week 8: Linked Lists

This week, we set aside recursion for a moment to give way to a new topic: Linked Lists! Basically, a linked list structure is made up of nodes that have a value and a reference to other nodes. The concept of objects (in this case nodes) pointing to other objects was very similar to how Trees worked.

In order to better understand how this data structure worked, I found it really helpful to draw out the nodes and arrows in the proper order. This technique was very helpful when I attempted to do the lab exercises. There were moments when I was really stuck, and drawing the picture bailed me out. By being able to see the linked list structure, I was able to figure out the right sequence in setting or resetting its attributes.

This week was also the first week that TAs went on strike. I understand where they are coming from, and I truly hope an agreement can be reached soon for the benefit of everyone.  

Saturday, February 28, 2015

Week 7

For the past few weeks, we have been focused on writing recursive code. We did several exercise sheets during lectures which I found was very helpful. Furthermore, we were required to write more recursive code during our past two labs. It was very good practice in getting a better understanding of how recursion works, and now I'm more comfortable with it than I was when the concept was first introduced. 

We were also introduced to another abstract data structure: Tree. What I found most especially interesting is not the Tree itself, bu the Binary Search Tree. With this type of data structure, we can easily locate data without having to go through the whole Tree! (This is assuming the BST is relatively balanced) Searching for data thus becomes very efficient since we can easily cut down our search space in half (left or right side of the node) as we find the value that we want.

I would like to be graded on my summary of of object-oriented programming which can be found in in my Week 4 and 6 posts. 

Thursday, February 12, 2015

Week 6: Summary of OOP Concepts

I've already written about some of my impressions on objected-oriented programming in my Week 4 post, so I guess I'll just expound on them some more here. Again, I cannot stress enough the importance and significance of using classes. It enables so much functionality, not just when writing code. Being able to extend attributes and methods of super classes to subclasses through inheritance is one of the great features of object-oriented programming. It provides this sort of structure to the code which can used for future code that is to be written. Not only that, object-oriented programming also allows for easier collaboration between people. Each person can work on a different part of the class separately, and eventually all of these code can be combined to become a working program. 

Thursday, February 5, 2015

Week 5: Tracing Recursion

We've finally been introduced to the concept of recursion last week! Looking at recursive code for the first time, I found it quite hard to comprehend. This is because even though I've seen functions call other helper functions before, I haven't seen a function call itself! And this is precisely what recursive functions do!

I found that tracing recursive functions on paper was extremely helpful in understanding how recursive functions work. Going through the activity sheet we were given in class showed me that having a function call itself doesn't seem completely ludicrous at all. It actually makes a lot of sense!  This activity also highlighted the importance of having a base case in order for the recursion to work. Furthermore, I noticed that recursive code itself is quite short. It's amazing how this short piece of code can be so powerful!

  

Monday, February 2, 2015

Week 4: First Week Impressions

I understand that CSC148 is a follow up to CSC108, which teaches basic programming. For the first weeks of class, it was clear that we students were being hammered on the importance of object-oriented programming. We spent a lot of lectures focusing on building and designing a class properly. For example, we were taught to choose the appropriate names for our attributes and methods. We also spent time on designing special methods such as __init__, __eq__, __str__ and __repr__ which I only found out about in this course. Learning about the built in function property() was also pretty amazing. It allowed get/set methods just like in Java or C#.

In talking about object-oriented programming, another neat feature we learned about is the concept of inheritance. Initially, I thought setting up classes with all its special methods was a a lot of work, and quite impractical. However, I guess all that work paid off when we created sub-classes which inherited the methods and attributes of the super-class.

Overall, this idea of classes and sub-classes all interacting with each other in a program is quite fascinating. I got to experience that first hand in completing Assignment 1. I hope to learn more in the weeks to come!  

Thursday, January 22, 2015

Week 3: Why Geeks Need to Know How to Write

Last year, I started the habit of keeping a personal journal wherein I would record anything interesting that happened to me during the day. It was as simple as noting down the places I went, some new things I tried, or shows that I watched, etc. It was my first time to engage in such a practice, and quite frankly I have found it very rewarding. Whenever I look back on the things that I wrote down, I get surprised by what I am able to read. There was so much detail that would have been forever lost to me had I not written them down. It became so clear that I can’t rely on memory alone.  

One reason why geeks or even just people in general need to know how to write is so that they can remember very important details. In the course of problem solving or debugging, it is very useful to take note of every step. This way, whenever you get stuck on something, you can always go back to your notes and maybe find something useful. And if you have a well written record of your problem solving process, it would definitely help other people who are trying to understand it. Having notes may also come in handy when you are face a similar problem in the future. By having notes, you wouldn't need to start from square one! It would save you a whole lot of time!

Perhaps the main reason why geeks need to know how to write is so that they can effectively communicate with the rest of the world. For example, only a select few of the human population can even read and appreciate technical stuff like code. Therefore, there is really no sense of developing groundbreaking technology if it’s just going to be ignored by the rest of the world because of a lack of understanding. Geeks need to know how to convey their great ideas in way that laypeople would appreciate and understand. Communicating may seem tedious at first, but if geeks don't persevere, then their ideas may all just go to waste.