Sunday, 8 February 2015

Week 5: Impressions of Tracing Recursion

As discussed in my earlier post, I didn't really have much of a first impression on recursion because I had already been introduced to this topic in high school. However,  I will discuss my thoughts about the way we learned recursion in class and how it further developed my understanding about recursion. To start off, we were introduced to the idea of recursion through small steps because it can be a rather confusing topic to explain. We first learnt about tracing through simple exercises which asked us to identify the output we would get given a certain argument for a recursive function. In my opinion, tracing was not too tricky until we reached the point where there were several nested lists. I remember having to literally write out each step on paper to actually be able to visualize the steps.

The next part was then to actually understand what was going on with the function itself. For instance, in lab 4, we were given a mystery function with no docstring and we had to fill out the function description, examples and return type ourselves. For me, this part took a little longer than tracing because I had to analyze every line and think about various situations where there could be an error. Moreover, since the beginning in CSC108, I have had trouble figuring out which examples to use for my examples in my docstrings and unittests. No matter how many times I read through the slide about what to look for when writing examples, I somehow still seem to struggle with that part. Hopefully by the end of CSC148, I can overcome this challenge and be master at choosing test cases / examples for docstrings.

The last step in fully understanding recursion was none other than having to write code in recursion ourself. Based on the recursive functions I have written by myself so far,  I would say that it hasn't been too hard. Unlike high school, the explanation of what to expect in our recursive function was very clear and concise. If you just follow the explanation, its very easy to figure out the base case and the recursive case. Hopefully, it stays this way in the future or else I will be spending hours trying to figure out how to write a recursive function like in high school.


Tuesday, 3 February 2015

Week 4: Impression of the first few weeks

Having just finished CSC108 a month ago, my transition to CSC148 seemed easier because the materials learned in 108 were still fresh in my mind. In CSC148,  the instructor picks right off from where we finished and introduces us to concepts beyond just loops, if statements and Docstrings. We are finally shown the true applications of programming; to write code that can help simplify everyday tasks. I had been waiting for this moment because having come from a java background, I had experience with writing client code and creating games with graphics. I still remember the excitement of our class when the instructor first drew a turtle on the screen with just a lines of code. It seems that the truly fun (and hard) part of programming is finally starting to unfold.


After having perfected our basics in CSC108, CSC148 puts together all that we learned and forces us to think outside the box. Recursion, for instance, is another way to write code efficiently and reduce the run time of a program. Although I had learned recursion before in java, after listening to the instructors explanation and tracing it, I now see recursion in a new light. Before this, I strongly disliked having to write code in recursive methods because it seemed so complicated to think about where to start and what the base statement should be. But now, I think I am finally beginning to understand the thought process one should go through to write recursive methods. So far, my first few weeks in CSC148 seem to be just about building upon the ideas I have learnt before and applying them to write some simple but time consuming code. The real hard part will start after our first term test- writing code in recursion.


Thursday, 22 January 2015

Week 3: Why Geeks Should Write

When you think about computer scientists, the first thing that pops up into your mind might be geeks programming in java all day long on their advanced gaming Lenovo laptops. Now it must be a given that these geeks must probably be pretty good at math and sciences, right? But what about English, which is generally a humanities subject and seemingly unrelated to Computer Science? Chances are, we computer scientists are probably not that great at writing or just English in general (if you are, then kudos to you because writing SLOGS probably comes naturally to you). I know that I was terrible in English no matter how hard I tried, I just could never grasp the importance of using metaphors and alliterations to grab the readers attention. Because lets be honest here; no matter how many literary devices Shakespeare uses, most of us would probably never read his plays if we weren't forced to in high school.

Now at this point you are probably confused as to why on earth my topic is titled 'Why Geeks Should Write' if I believe that writing is probably not the strongest asset of a programmer. To be frank; because computer scientists are not good at writing and expressing their thoughts in words, they should write more so that their writing skills can improve! I am a strong believer in the philosophy of 'practice-makes-perfect'. So while practise may not make you perfect at writing because we all have strengths and weaknesses, if you are able to improve your weakness then thats much more valuable than a person with amazing strengths but big shortcomings.

What might be some advantages of geeks writing? The advantages are endless! Writing is used in everyday life whether you are a student, a worker in your forties or even retired. To get a good job, no matter how many programming languages you might know, it all comes down to whether you can woo the employers with your writing skills on that cover letter for Google. Moral of the story: writing is good for geeks even though we may hate it, so get going and start working on those metaphors you think of when walking to CSC148 on College Street!