Thinking back on the year, I'm pretty surprised how much I've learned: object oriented programming, abstract data types, recursion, trees, and minimax most notably. CSC108 was the first computer science course I had ever taken, and now CSC148 is the second.
Unlike 108, I like the pacing and the way 148 was presented a lot more. In 148 assignments there was a lot more open-ended-ness, and a lot more struggling. Rather than filling out methods, I got to design my own classes, which was exciting, yet also pretty difficult at the beginning. I enjoyed the assignments a lot more than I though I would, but that might just be because games are a lot more interesting than poetry.
Like 108, thankfully, the tests were really appropriate. They weren't unexpected, unlike some tests in some other courses I took this semester... It was nice having a wrapper after each one which forced me to review it, because I have a tendency to bury tests that I do badly on, and ignore ones I do well. The labs were really critical to learning the course material, and they were well timed; I typically finished a bit early on normal weeks, and had a lot of time to review on weeks with assignments or tests.
I don't really know what to think of this SLOG though. Have my communication skills improved because of this SLOG? Probably not - if I have improved (which I probably haven't) it's because of the essays I've had to write for other courses. On the other hand, it did actually help me with reviewing material.
CSC148 was definitely an great course, and it would probably have been the best course I took this semester if not for a certain really, really outstanding other course I took. Professor Horton is also one of the nicest professors I've had. I really look forward to taking other computer science courses in the future, and learning languages other than Python.
Monday, April 6, 2015
Revisiting the very beginning
Not much has changed - I'm still the same carefree person who wrote "Week 1-3 Impressions", and I encountered very similar problems in Assignment 3 as A1, which I talked about in that post.
Actually, who am I kidding - yes, I have changed quite a bit. Firstly, I don't forget to close brackets anymore as often. Maybe it's because A3 didn't have as many situations with multiple brackets, or maybe it's because I'm now used to double checking and counting brackets in those situations; either way, I'm a bit more proficient in avoiding syntax errors. The most significant difference is probably motivation. Reading my old SLOG post reminds me of how motivated I was, being so invested in A1 that I did most of it two weeks early. This time, I did A3 two days early. This isn't just the case for CSC148; something similar has happened with all my other courses, and also with my courses last semester. I guess that at the beginning of every semester, everything is new and shiny. The novelty of the experience trumps the work and effort, but later on, that's no longer true. I wrote at the end of that blog post: "CSC148 has been great, and from what I've seen of recursion so far, it will almost definitely get more interesting," and I can't disagree with myself. CSC148 is still great, and the course definitely got more interesting with recursion. I just wish I were as motivated as I was at the beginning of the semester.
Actually, who am I kidding - yes, I have changed quite a bit. Firstly, I don't forget to close brackets anymore as often. Maybe it's because A3 didn't have as many situations with multiple brackets, or maybe it's because I'm now used to double checking and counting brackets in those situations; either way, I'm a bit more proficient in avoiding syntax errors. The most significant difference is probably motivation. Reading my old SLOG post reminds me of how motivated I was, being so invested in A1 that I did most of it two weeks early. This time, I did A3 two days early. This isn't just the case for CSC148; something similar has happened with all my other courses, and also with my courses last semester. I guess that at the beginning of every semester, everything is new and shiny. The novelty of the experience trumps the work and effort, but later on, that's no longer true. I wrote at the end of that blog post: "CSC148 has been great, and from what I've seen of recursion so far, it will almost definitely get more interesting," and I can't disagree with myself. CSC148 is still great, and the course definitely got more interesting with recursion. I just wish I were as motivated as I was at the beginning of the semester.
Weeks 7-9
I have to admit that I really miss the labs and TAs, and almost every other SLOG I've read has said the same (some of the SLOGs are in the side bar under "10/10 would SLOG again"). Without physically going to the Bahen computer labs, without the presence of other furiously coding peers and Afarin (my TA), it's difficult to find motivation to do the lab exercises. I learn a lot more from labs than from lectures most of the time.
A lot of has happened in three weeks. Most noticeably, we had our second term test, which was definitely not as easy as the first test. I got to the test a bit late because I had woken up late, and forgot to pull out my cheat sheet when getting my stuff. I only realized this after the test was over, when others were folding up their cheat sheets, but thankfully, I don't think much would have changed even with it. The first question of the test involved maximizing and minimizing the height of a 20 node binary tree, and traversing a tree using pre-order traversal. I was groggy, and it took a while for me to remember what pre-order traversal was, but I got it in the end. The second question involved writing the body of the recursive function "list_even_between", a function very similar to "list_between", which I had implemented in a lab previously. That question was relatively straight-forward. Question 3 involved a Linked List method called "absorb_value". I found this one more challenging than question 2. This, coupled with the fact that I was running out of time made it really, really difficult. In the end, I forgot to update the size of the linked list, among some other minor things. In the end, test 2 was definitely not the best display of my abilities. Just like the first term test, I also had another midterm later that afternoon, and I made sure to apply what I had done badly with my 148 midterm (being late, not pacing myself properly) to that midterm. Hopefully my final exam is better...
A lot of has happened in three weeks. Most noticeably, we had our second term test, which was definitely not as easy as the first test. I got to the test a bit late because I had woken up late, and forgot to pull out my cheat sheet when getting my stuff. I only realized this after the test was over, when others were folding up their cheat sheets, but thankfully, I don't think much would have changed even with it. The first question of the test involved maximizing and minimizing the height of a 20 node binary tree, and traversing a tree using pre-order traversal. I was groggy, and it took a while for me to remember what pre-order traversal was, but I got it in the end. The second question involved writing the body of the recursive function "list_even_between", a function very similar to "list_between", which I had implemented in a lab previously. That question was relatively straight-forward. Question 3 involved a Linked List method called "absorb_value". I found this one more challenging than question 2. This, coupled with the fact that I was running out of time made it really, really difficult. In the end, I forgot to update the size of the linked list, among some other minor things. In the end, test 2 was definitely not the best display of my abilities. Just like the first term test, I also had another midterm later that afternoon, and I made sure to apply what I had done badly with my 148 midterm (being late, not pacing myself properly) to that midterm. Hopefully my final exam is better...
Recursion
(So... it's been a while since I've updated my SLOG. I hope it isn't too late. DX)
Recursion is great! Before CSC148, the only experience I had with recursion had to do with Fibonacci numbers and fractals. Like with recursion ideas in computer science, trying to do things done with recursion without recursion is painful, and almost impossible. For Fibonacci numbers, defining them recursively looks like this: F(n) = F(n-1) + F(n-2), where F(n) is the nth Fibonacci number. Defining them non-recursively, however, requires radicals and the golden ratio (see: http://en.wikipedia.org/wiki/Fibonacci_number#Closed-form_expression).
Learning recursion in CSC148 is like learning a new way to think. Instead of thinking of a tree as a (real life) tree, recursion is more like thinking of it as broccoli; trim off a broccoli floret, and you get a mini broccoli! (Cutting a branch off of a tree doesn't really make another tree. Ok, I guess a branch is kind of shaped like a tree.) Recursion is thinking of every (computer science) tree as a collection of other trees.
Whenever I write a recursive function, I start with the base case (I'm sure everyone else starts here too). What if I had the smallest possible piece of a broccoli? Find the simplest tree and write code for that. What I forget to do a lot of the time, and what is really important, is remembering what it is the function returns. Maybe the function returns a list of ints, and the base case produces only an int - never forget to turn it into a list! Next, I think of the big broccoli, but rather than thinking of the broccoli just as broccoli, I think of it as a collection of smaller broccoli. What do I get out of the smaller broccoli, and how do I combine it? What really helps is thinking of each of the tree nodes, the child and the parent as essentially identical. I'm not entirely sure how to describe it, but, rather than thinking of the exact process, I think of what combines the two nodes, and then (most of the time) everything works out.
Recursion is great! Before CSC148, the only experience I had with recursion had to do with Fibonacci numbers and fractals. Like with recursion ideas in computer science, trying to do things done with recursion without recursion is painful, and almost impossible. For Fibonacci numbers, defining them recursively looks like this: F(n) = F(n-1) + F(n-2), where F(n) is the nth Fibonacci number. Defining them non-recursively, however, requires radicals and the golden ratio (see: http://en.wikipedia.org/wiki/Fibonacci_number#Closed-form_expression).
Learning recursion in CSC148 is like learning a new way to think. Instead of thinking of a tree as a (real life) tree, recursion is more like thinking of it as broccoli; trim off a broccoli floret, and you get a mini broccoli! (Cutting a branch off of a tree doesn't really make another tree. Ok, I guess a branch is kind of shaped like a tree.) Recursion is thinking of every (computer science) tree as a collection of other trees.
Whenever I write a recursive function, I start with the base case (I'm sure everyone else starts here too). What if I had the smallest possible piece of a broccoli? Find the simplest tree and write code for that. What I forget to do a lot of the time, and what is really important, is remembering what it is the function returns. Maybe the function returns a list of ints, and the base case produces only an int - never forget to turn it into a list! Next, I think of the big broccoli, but rather than thinking of the broccoli just as broccoli, I think of it as a collection of smaller broccoli. What do I get out of the smaller broccoli, and how do I combine it? What really helps is thinking of each of the tree nodes, the child and the parent as essentially identical. I'm not entirely sure how to describe it, but, rather than thinking of the exact process, I think of what combines the two nodes, and then (most of the time) everything works out.
Monday, February 9, 2015
Week 4
I have a really busy week, so I'll keep this SLOG short. (Also, I think the length of my previous SLOGs should be able to compensate.)
Last week was our first term test, and just like what Professor Horton said, it was straightforward. We wrote code for a class, traced a recursive function, and then wrote code for a subclass (and its superclass). The questions were similar to what we had been doing during quizzes and for assignment 1. I was really thankful that the midterm was relatively stress free because I had another midterm later that day.
The quiz on the other hand, was amusingly more tricky than the test. If I hadn't encountered a similar problem during the lab, I probably would have gotten the quiz wrong and thought that I had done it right.
Swift-ish Goat followers (if you exist), what did you think of the test and quiz this week? How would you compare their difficulties?
Last week was our first term test, and just like what Professor Horton said, it was straightforward. We wrote code for a class, traced a recursive function, and then wrote code for a subclass (and its superclass). The questions were similar to what we had been doing during quizzes and for assignment 1. I was really thankful that the midterm was relatively stress free because I had another midterm later that day.
The quiz on the other hand, was amusingly more tricky than the test. If I hadn't encountered a similar problem during the lab, I probably would have gotten the quiz wrong and thought that I had done it right.
Swift-ish Goat followers (if you exist), what did you think of the test and quiz this week? How would you compare their difficulties?
Monday, February 2, 2015
Week 1-3 Impressions
In the past few weeks, we've gone over things like defining __repr__ for classes, inheritance, list comprehensions, abstract data types, and just classes in general. What I've found most interesting has been list comprehensions, and what accompanies that interest is a sort of mild frustration. Why did we not learn these earlier, like in CSC108? When I think over all the code I wrote for CSC108, so many lines could have been saved if I had just known about the existence of list comprehensions. However, I'm sure that the instructors had a good reason for this delay. One possible reason is that using 'for' loops and the 'append' method is a good way of practising more elaborate code that can't be done with list comprehensions. Also, I know (based on a quick Google search) that list comprehensions are not universal (for example, Java does not support them). So, the loops that we used in 108 are more applicable to other languages, and the fundamentals of programming. (Despite these reasons, I'm still somewhat irked.)
Another highlight of the past few weeks has been, of course, assignment 1. I cannot deny that I enjoyed doing assignment 1. I read the handout one evening, and then was so engrossed in it that I accidentally stayed up until 4am to finish the bulk of it (thankfully, it was a Saturday evening). When I was done, I got my (non-CSC148) friends to play Subtract Squares, and tweaked the game view until it fit my standards of visual appeal. Assignment 1 passed without too many major problems. I missed a lot of brackets, and had to fix those many times. There was one point where my report_win method in the GameView class kept claiming that the computer had won, and the problem with that method happened to arise from a problem in another method in my Game class, so that was a bit painful.
The most interesting problem arose from my choice of letting the user determine the upper random number limit. My friends tried to 'break' my program by setting numbers like '123123123123123123123123123123123123123123' as the upper limit, and (un)fortunately, they succeeded. The following error message would appear: "builtins.OverflowError: Python int too large to convert to C ssize_t", so my obvious response was to add an 'except OverflowError' statement to my input line. Yet, the error message would still appear. After much deliberation, one of my friends suggested that perhaps it was the code several lines afterward, rather than the input statement that caused it, and I looked into that. It turns out that the list of possible moves that arose from such a large number was too large, and that was what caused the problem. So, I fixed my code with an 'except' statement in the right place.
CSC148 has been great, and from what I've seen of recursion so far, it will almost definitely get more interesting.
Another highlight of the past few weeks has been, of course, assignment 1. I cannot deny that I enjoyed doing assignment 1. I read the handout one evening, and then was so engrossed in it that I accidentally stayed up until 4am to finish the bulk of it (thankfully, it was a Saturday evening). When I was done, I got my (non-CSC148) friends to play Subtract Squares, and tweaked the game view until it fit my standards of visual appeal. Assignment 1 passed without too many major problems. I missed a lot of brackets, and had to fix those many times. There was one point where my report_win method in the GameView class kept claiming that the computer had won, and the problem with that method happened to arise from a problem in another method in my Game class, so that was a bit painful.
The most interesting problem arose from my choice of letting the user determine the upper random number limit. My friends tried to 'break' my program by setting numbers like '123123123123123123123123123123123123123123' as the upper limit, and (un)fortunately, they succeeded. The following error message would appear: "builtins.OverflowError: Python int too large to convert to C ssize_t", so my obvious response was to add an 'except OverflowError' statement to my input line. Yet, the error message would still appear. After much deliberation, one of my friends suggested that perhaps it was the code several lines afterward, rather than the input statement that caused it, and I looked into that. It turns out that the list of possible moves that arose from such a large number was too large, and that was what caused the problem. So, I fixed my code with an 'except' statement in the right place.
CSC148 has been great, and from what I've seen of recursion so far, it will almost definitely get more interesting.
Saturday, January 24, 2015
Why geeks should write
Honestly, I am not fond of writing. It requires re-reading, revising, and editing, and so, too much time for my liking. Even before that phase, I often find it challenging to figure out what exactly to write about and what words to use. A word with the wrong connotation could give the reader the wrong impression of a sentence, a paragraph, or a whole article. Imprecise explanations to problems through bad organization or confusing sentence structure can cause even more problems.
I would much rather have the ability to transfer my raw thoughts to someone by staring at them menacingly. Unfortunately, I, and humans in general, just can't do that. So, often times, we have to revert to writing - good, precise writing as a crucial method of communication. Good writing can only be achieved with practice, with more writing (like this SLOG). The ability to effectively communicate thoughts to other humans and to our future selves, in my opinion, should be a good enough reason for anyone, not just geeks to write.
An analogy:
A while ago, I was watching the League of Legends NA LCS tournament, and it got me thinking of the similarities between pro-gaming and programming (beyond their spelling, and beyond both involving 'geeks'). One of the most critical parts of League is that it is a team game, similar to how programmers often work in groups. Team members, especially at a professional level in League, need to be able to perfectly co-ordinate engages and disengages to ultimately win the game. While most of League of Legends communication involves screaming a certain player's name, or giving simple instructions like 'push', 'flank', and 'seige' it is insanely important. For professional gamers, each simple command is implicative of a set of actions predetermined in past practices, like a function or method in a program.
In programming, we don't have the luxury of being able to pre-explain all our code in person for everyone who reads it, which is why we have docstrings and debugging journals, written explanations to back the 'screamed instructions' in our code. Without a backstory, a record, readers of our code (whether it be others, or ourselves) are as confused as spectators listening in on a jumble of screams, and thus less likely to see our work as valuable. Communication through writing makes a programmer easier to understand, and thus easier to work with, help, and succeed with.
So, just like how someone can be the most skilled League of Legends player but never win because of their inability to communicate with their team, a 'geek' could be the greatest coder, but never become successful or contribute to society because of their inability to explain their work to others through writing.
I would much rather have the ability to transfer my raw thoughts to someone by staring at them menacingly. Unfortunately, I, and humans in general, just can't do that. So, often times, we have to revert to writing - good, precise writing as a crucial method of communication. Good writing can only be achieved with practice, with more writing (like this SLOG). The ability to effectively communicate thoughts to other humans and to our future selves, in my opinion, should be a good enough reason for anyone, not just geeks to write.
An analogy:
A while ago, I was watching the League of Legends NA LCS tournament, and it got me thinking of the similarities between pro-gaming and programming (beyond their spelling, and beyond both involving 'geeks'). One of the most critical parts of League is that it is a team game, similar to how programmers often work in groups. Team members, especially at a professional level in League, need to be able to perfectly co-ordinate engages and disengages to ultimately win the game. While most of League of Legends communication involves screaming a certain player's name, or giving simple instructions like 'push', 'flank', and 'seige' it is insanely important. For professional gamers, each simple command is implicative of a set of actions predetermined in past practices, like a function or method in a program.
In programming, we don't have the luxury of being able to pre-explain all our code in person for everyone who reads it, which is why we have docstrings and debugging journals, written explanations to back the 'screamed instructions' in our code. Without a backstory, a record, readers of our code (whether it be others, or ourselves) are as confused as spectators listening in on a jumble of screams, and thus less likely to see our work as valuable. Communication through writing makes a programmer easier to understand, and thus easier to work with, help, and succeed with.
So, just like how someone can be the most skilled League of Legends player but never win because of their inability to communicate with their team, a 'geek' could be the greatest coder, but never become successful or contribute to society because of their inability to explain their work to others through writing.
Subscribe to:
Posts (Atom)