Taylor Lunt's SLOG

A Course Log for CSC165H in Fall 2014

Week 12: We Did It, Hooray!

Last impressions of CSC148:
The course was okay. I don’t feel like I’ve really learned a lot, at least, not in comparison to other courses. The assignments were probably the only useful part of the course, and even then the third assignment was kind of short (though I understand, in light of the strike, why that might be). I don’t think there was any point where I struggled with a concept in this course for more than a few minutes, and since we were given weeks to learn such topics there was no issue. SLOGs have been a waste of time in my eyes. I already journal on my own, so forcing me to do it again but publically isn’t helpful. Even if I didn’t on my own, I’m sure public forced journaling isn’t as amazing as the type of journalling being done in the studies which probably prompted SLOGs in the first place. I hope future computer science courses at UofT blow this one out of the water.

Week 11: Go back 7 spaces.

This week we covered a lot about assignment 3, which I have now completed, as well as some material concerning sorting algorithms. Mostly it was review from CSC108, but we did cover one new algorithm: quick sort. I’m not usually that ahead in terms of computer science theory, but I was already familiar with this due to the following computerphile video:

This week I’m supposed to look back at a previous post and see if I agree or disagree with my past self. I’ll look at my post from week 4, found here. It’s only been 7 weeks since this was posted, so it’s not like my opinions could have shifted too drastically. In the post I briefly touched upon the idea that the pragmatic side of computer science (ie. programming) is best learned on one’s own. Given my 7 more weeks of experience with computer science classes, I still agree. The only really helpful part of CSC148 so far has been the assignments, which essentially involve teaching oneself. I do realize since writing that post that I left out about two weeks of casual participation in Project Euler (20 problems) when I was comparing how I learned the basics of programming to how they are taught in a university classroom, so that may be something worth noting. Otherwise, though, what I said still stands.

Week 9 and Week 10: Two Can Be as Bad as One

Week 9 had the exam, and I didn’t feel like it would be worth it to write an entire post for just one lecture, so this is a combined post for weeks 9 and 10.

In the lecture in week 9, we covered more on binary search trees and the insert function, which I haven’t had an issue with. Actually, we spent a lot of the class talking about the test, hence this combined post. We also talked about deleting elements of a binary tree, which causes the tree to shift around in a simple manner to compensate. This week (week #10) we talked a lot about assignment 3 and how that will work. I’m not liking the concept behind assignment 3 but I think it should be simple enough. We also did a CSC108-level assignment, so during that class I drew a picture of a horse in a shoe store.

Week 8: The Next Post is Week 9.

This week we encountered linked lists, which I have learned about before. I was curious actually as to in what circumstances you would want to use a linked list as opposed to a regular list/array, as that sort of thing is unfortunately never mentioned in class, so I looked it up. It seems like they are mostly used for efficiency reasons, since insertions/deletions from the list are faster due to the fact that there is no need to possibly have to re-declare (I assume implicitly in Python) the size of the list if it gets too large. In Python, though, it seems like linked lists aren’t often used (due to the high-level nature of the language), but if you do need to use a linked list or similar for efficiency reasons, then a deque is recommended.

Week 7: One way, or another, I’m gonna find you…

The instructions for the slog get more and more esoteric as the weeks roll by, and it has been said to do the summary of object oriented programming in week 7 in one spot and in week 6 in another, so since I have already covered that last week I will this week just give a standard slog.

This week we talked about binary trees, which are really just a dumbing-down of regular trees and should have only taken about 5 minutes to teach. Then we covered binary search trees, which are less of a topic which we have already essentially covered in CSC148. However, we have already covered binary search algorithms in CSC108, so the covering of binary search trees was just more of the same.

I was recently asked by someone, since I mostly focus in my slogs on things which I have found easy, if there has been anything in CSC148 which I have found challenging which I should focus on instead. My answer to that question is no. It’s not because I’m some computer science wizard, and that’s not what I’d want anyone to think. It’s because I have to teach myself how to program because I wouldn’t want to risk having to be taught how to do so by an instructor at UofT. Programming is a difficult thing to teach, and naturally the instructors here do a poor job of it. There is a problem in computer science education, from what I can tell, not just here but everywhere. It’s a new subject and people don’t know how it should be taught. The best classes just have the students teaching everything to themselves. The worst classes have the teacher go line by line through code about abstract data types on an overhead projector and then have tests on paper (eg. here). Clearly what is needed for a computer science education is being taught by the students to themselves or not at all. You don’t get competent programmers by taking newbies and teaching them about compilers this and stacks that; there needs to be problem solving constantly and using code like you would English in English class. You don’t create writers by teaching them all about the simile and sentence structure and then by giving them assignments which state “First write a paragraph about Romeo and why he is upset. Then write a paragraph about why Juliet did what she did.” People need to be given a problem and allowed to work through it without endless specification. “But then how do we mark it?” There’s where the poison comes from. Computer science seems to be compartmentalized into neat little categories of abstract theories to the point where the whole system just pushes out people who know all about queues and types of inheritance and know nothing about writing programs or how computers/computation really works. I want to avoid being one of these people and so, as probably a large portion of the students here do, I teach myself some things to avoid learning little of importance. I want to avoid missing the forest for the binary trees. I don’t know all about abstract data types, but I can code, so I pick them up in class easily. The way the course is being taught makes me fear that if I didn’t stay ahead of things on the pragmatic side I wouldn’t learn anything in class. There are also more specific issues, such as the fact that the lecture format sucks, the lab format is mediocre, and the test format is laughable. No I don’t find anything in this class challenging (other than how it is being taught), because I go out of my way to teach myself everything core to what I need to know in advance to avoid having to learn it in class, because if I did learn just from class my learning would be rocky. Some people probably find this class challenging. The class is challenging because of the barriers put in front of them by the way the class is being taught, I think, rather than their own personal failings. The material is easy, but the students are being disserviced into thinking that the material is challenging when in reality it is just obtuse/convoluted.

Week 6: A Gorilla Holding the Banana and the Entire Jungle

The material this week has been about trees. I’m glad I’ve finally gotten to see how they work as I had heard of them before but had never seen them in action. They aren’t challenging or anything, though, so they have given me no issue.

The SLOG handout and the course calendar seem to conflict about which week I am supposed to summarize object-oriented programming, but I will assume this is that week.

From what I understand, object-oriented programming involves the fancy high-level abstraction of tasks into tasks which primarily involve “objects”, which are vague data structures which are instantiated from a class. For example, you may have a class of a generic Animal, and an object which is an example Animal, perhaps with the name attribute “Sparky”. One of the advantages of object-oriented programming is the idea of subclassing, which involves the creation of a specific subclass based on a generic parent class which will automatically be able to use the methods and usually the attributes of the parent class. In the given example, we could create a subclass of Animal called Dog which would represent a generic dog. Then we could create an instance of Dog and then it would automatically have all of the methods of Animal, and the attributes of Animal assuming we extended the initialization method. This means that we could write all of the code for giving animals names in Animal and then Dog would automatically inherit this code, so we could name our Dog “Rover” without hassle. If Animal had a method which allowed it to eat, called eat_food, our Dog class would automatically inherit this method and Rover would be able to eat without any extra hassle. Languages which allow for duck-typing allow you to use an animal and call it’s eat_food function without knowing what type of animal it even is! As long as it walks and quacks like a duck, let’s treat it like a duck.

Object-oriented programming isn’t a magic panacea for all programming problems, though. When asked why he didn’t use C++ instead of C to build Git, Linus Torvalds criticized the inefficiency which can be present in object-oriented programming, but mainly the inefficient thinking that comes along with using object-oriented programming in certain contexts. It seems that many or at least some programmers spend their time only in highly-abstracted environments, never learning to work on a machine level in a language like C. Torvalds said that the decision to use C was worthwhile even just for the fact that it kept the C++ programmers out. Object-oriented programs come with a lot of baggage, as well, and can be difficult after implementation to re-work the code into a more efficient abstraction if necessary. Luca Cardelli said that “the problem with object-oriented languages is they’ve got all this implicit environment that they carry around with them. You wanted a banana but what you got was a gorilla holding the banana and the entire jungle.”

References:
http://article.gmane.org/gmane.comp.version-control.git/57918
https://en.wikipedia.org/wiki/Object-oriented_programming#Criticism

Week 5: class CSC148Test(unittest.TestCase):

We covered unittests, which were already fully covered in CSC108. We also kept on covering recursion, which is simple to understand and I understood already. The only thing worth mentioning that happened this week was the first midterm test. It went well, or at least I think it went quite well, but I won’t be certain until I get my mark back. In any case the exam seemed pretty straightforward and none of the concepts were challenging.

CSC148 Week 4: Did you mean: recursion?

I was already familiar with the concept of recursion prior to learning it in class, so the material this week wasn’t very challenging. After getting through 108 and now a few weeks of 148 and having only really learned about docstrings, I am amazed at how well two weeks of online tutorials in Python (and a couple of weekend game jams) can compete with more than a semester of computer programming classes in the best university in the country. I guess programming is really something learned best on one’s own and, given the novelty of the field, teaching it in a classroom is still a new concept and as such leaves much to be desired.

At risk of spoiling the mystery which goes into my titles, I’d like to subtly mention that if you search “recursion” in Google, it will spit out the phrase “Did you mean: recursion”.

CSC148 Week 3: Those Who Don’t Know Computer Science are Destined to Repeat SLOG

This SLOG was also used as a SLOG for CSC108, but from this point on will be used as a SLOG for CSC148.

Since this is the SLOG entry for the third week of the course I am required to detail why geeks need to know how to write. Therefore, here is a list of reasons why geeks should write:

1. Documentation: Nobody wants to have to wade through poorly documented code. Being able to write well will translate to being able to keep good documentation of your code and write better comments, which will help other people as well as your future self understand why and how you have done what you have done.

2. Keeping logs: Some problems take more than one or two days to solve, and when this is the case it helps to keep logs of what is going on. Depending on the length of the problem this can range from the haphazardness of a flurry of sticky-notes to a sophisticated logging program, but in any case keeping track of what is going on in the problem solving process helps to avoid repeated work and keep on track. Improvement in writing skills translates to improvement in logging skills.

3. Communication in the real world: Computer scientists don’t just write code all day. They have to communicate with team members, employers, clients, testers, end-users, and the computer science world in general. If you can write brilliant code but you can’t tell anybody about it or why it is brilliant then nobody will care. And if you can’t communicate properly with the people who are determining the specifications of the code you need to write in one way or another, be they end-users or employers, then you might have a difficult time writing brilliant code to begin with. Being able to communicate effectively is clearly a requisite skill if one wants to be an effective “geek”.

4. Journaling: This is something I do on my own, which is why I find SLOGs to be laborious and contrived, and it is of great value. Writing to your future self and documenting your life in general requires writing skills (and improves in tandem with writing skills). This isn’t something which is restricted to computer scientists/geeks, but they, like anyone, will be more effective at what they do if they are able to write to themselves on a regular basis. It also makes you happier.

Clearly, for all of these reasons, a geek who can write effectively is better off both on the job and off than one who cannot.

Since this is the first SLOG of CSC148 I will also briefly outline how I feel about the course so far: I already know all of what has been taught so far, so the material hasn’t been challenging. I feel as though the assignments will be interesting, however, and I think we will soon enter the territory of information I don’t already posses.

Week 13: I Came, I Saw, I Computed

We only had one class this week, so seeing as this is my last SLOG I thought it would be more appropriate to comment on the course as a whole rather than on this week specifically.

Overall I found the course to be not particularly challenging. The material was somewhat difficult, yes, but the most difficult of it was always taught to a greater depth in my calculus class before we even reached it in CSC165. Also, in this class, the material was tough but the scope of the material was small, such that I knew what to expect on exams.

The greatest challenge in this course, the lack of instruction quality and a lack of real resources to consult (due to the course notes simply being a regurgitation of the same lack of quality) never became too much of an issue for me. I am, however, disappointed that this course was my introduction to computer science theory. I enjoyed the material in its own right, just not how it was presented.

I’m glad I got through it and I’m glad it’s over. I hope CSC148 will be better.