Saturday 31 January 2015

Week 4: Programs come in all shapes and sizes

In yet another special edition of "Life in CSC148," I will be covering the first three weeks. Upcoming SLOG entries will focus on the past week unless otherwise stated. Oh, and I am currently feeling overwhelmed because I have tests for CSC148 AND MAT137 on Wednesday! Eeeeep! I shall discover ways to de-stress! (Hot chocolate. Writing. Deep breathing. Happy thoughts.)



Let's start with Week 1. I was very happy to see Professor Heap again on the first day of CSC148. He's been supportive when I was struggling in CSC165 last semester and getting low marks. (Not to mention, I've had mental breakdowns over CSC165. "It's too hard! I don't get it!" I would often think to myself, seeking positive solutions.) Not only has he supported me, but he has supported many others who might have been in the same position. I found CSC165 increasingly difficult and he was always willing to help others who thought the same thing. I'm sure he will do the same thing for me in CSC148 should things be difficult again.

I'll be honest. I'm not the best programmer ever. (I'm a n00b.) I've taken computer science in grades 10 and 11. I've worked with Turing and Scratch in grade 10, and Java in grade 11. Then I learned Python in CSC108 after a moderate hiatus from programming. (I didn't do as well in CSC108 as I did in CSC165, though.)

We covered classes on the first week as part of object-oriented programming, which we learned during the last bit of CSC108. We've gone over __init__ and __eq__ methods. Since I just came out of CSC108, I was beyond familiar with the methods. __init__ is used to initialize a class and __eq__ compares one variable in the class (self)to another (other). In class, Professor Heap used the Python Turtle Graphics module to create shapes to support his teaching of concepts.

In week 2, we covered __str__ and __repr__ methods. We also began to look at abstract data types (ADTs for short), inheritance, including subclasses in the form class NewClass(OldClass), and recursion. In week 3, Prof. Heap used the Turtle module again while teaching us recursion.




Our first assignment for the course was due on Thursday night. My group and I visited Prof. Heap and Prof. Horton's office hours to check our work and see if we did anything wrong. It took us many gruelling hours to fix bugs and proofread our code. After the coding has gotten out of the way, we added comments and docstrings. The final product: 500+ lines of code. But it was all worth it.

I would like to wish everyone the best of luck on next week's CSC148 test! (And MAT137 for whoever's currently taking it.)

Now to study hard and get some motivation.


Until next time, folks! (Study hard and rest up before the test!)

Thursday 22 January 2015

Week 3: Intro + why geeks need to write

Hello and welcome to my CSC148 SLOG! This is my second SLOG; my first SLOG was for CSC165, which I took last semester. (In addition, I have Professor Heap once again! He's just amazing to have.)

I have newfound experience programming in Python from CSC108. I hope to improve my Python skills in CSC148; computer science is important to me because it is my utmost interest. I also like to lend my programming knowledge to real world situations, and because I have additional interests ranging from math to environmental studies, I'm considering doing a major and two minors or a double major, but I'm terribly indecisive so I'm really on the fence when it comes to choosing major/minor/specialist programs. (I would appreciate some advice in the comments below.)



I will document my progress (and vent out my frustrations) in CSC148, and some weeks will focus on a certain topic. (More or less, I'll be posting something every week, so stay tuned!) This week, I will be discussing why geeks (well, computer scientists, in this case) need to know how to write. (Being a geek is not a bad thing!)

When we think of writing in the everyday world, we think of things like:

  • literature.
  • English class.
  • a real-life journal or notebook. 
  • pen(cil) and paper.
  • word processing. 
  • those hand motions you do, writing utensil in hand.
  • blogging. (Hey, here's a blog!)

However, in computer science, writing is key. When computer scientists think of writing, they mainly consider things like writing lines of code and documentation. Writing must be clear and concise so that others who will see the code can understand what's going on.


Keeping a log of bugs is an example of writing in computer science. Computer scientists write about the bug, going in depth about the problem and solution.

This blog that I've read explains how "debugging journals" work. Problem solving is an important skill that computer scientists must have. Therefore, when we record a bug and its solution, we can go back to it later.


In the end, computer scientists all learn a thing or two after they keep a log of the bug. Debugging journals take on many forms (e.g. note-taking app, paper notebook), according to the blog. We do these SLOGs to practice the art of problem solving in computer science by keeping logs. Here, we write about our impressions week after week (unless otherwise stated). In my CSC165 SLOG, I recorded difficulties, accomplishments, and the like, which in turn helped me do well in that course because I looked back at what I've written in case I forgot anything!

Here's another blog I've read. Joel has composed seven pieces of advice for computer scientists. The first advice he has given us is to "learn how to write before graduating." Communicating ideas to other people is another key point that Joel brings up in his blog. So, when it comes to code and documentation, clarity must be present or everything will be discarded should it have no clarity. Joel hits the nail on the head when he says:

"Start a journal or weblog. The more you write, the easier it will be, and the easier it is to write, the more you'll write, in a virtuous circle."

These SLOGs are good practice. (And promises for a stellar future.) Looking back at my first post on my CSC165 SLOG, I feel like I have come a long way since then.

Feel free to leave a comment, and keep following, my fellow CSC148 students (and TA)!