Monday, 30 March 2015
Week 9: Impressions of Week 8
In week 8 of the wonderful world of CSC148, we learned about the properties and applications of Linked Lists, another ADT. Linked Lists mark the first time since pretty early on in the course that the subject material hasn't been involved with recursion in some way. Working through the lab, I was kind of surprised at how simple the exercises ended up being. I quickly figured out that the solutions to the majority of the exercises were a straightforward matter of updating the start and end of the list if applicable, then changing simple connections between nodes in the list. The experience was particularly interesting because my prior work with lists usually involve using built-in methods to do all the work updating and changing the lists without me ever having to think about exactly how these methods are accomplishing their goals. In week 8, the lab got me thinking about exactly what lists are: a bunch of nodes consisting of data values and a pointer to the next element in the list. I figure this will be somewhat similar to when I start learning lower level languages like C, where all of the internal workings that Python hides from me will be laid bare. I'm excited to be more exposed to this kind of material so I can learn more about how to make my code faster, more efficient, and better suited to the modern world.
Thursday, 19 March 2015
Week 8: Impressions of Week 7
Here in CSC148 throughout week 7, we were introduced to the abstract data type of the binary tree. Building upon the generic Tree ADT that we were introduced to earlier in the semester, the binary tree has the special characteristic of having up to two child nodes designated "left" and "right". Personally, one of the really radical things about the binary tree (and by extension, the tree) is how the class is kind of "recursive" simply in its existence. When I say that, I mean that the tree is essentially made up of a node that points to two smaller trees. In addition, the trees are stored through a class that keeps track of nodes, with internal nodes also keeping track of their children and their children's children. The root node of humongous trees with millions of children is an instance of the same class that each and every child node is also an instance of. If there was ever an ADT that was perfect for recursion, this is it.
As mind-boggling as recursion has a tendency to be at times, the class designed around recursion was just as mind-boggling as I expected. Going through the exercises in labs, I managed to gain a pretty solid grasp of what was going on, but the whole system of having trees contained inside of nodes of trees and having an entire tree represented in a single node was kind of a weird concept to wrap my head around. By the end of the lab, I had built-up the same relationship with the implementation of the binary tree as with the limit in calculus and particle-wave duality of electrons in physics: I could solve problems with them and I accepted that they existed and were valid, but the concepts didn't seem to fit quite right in my head. Hopefully, with time and more practice, I'll gain a stronger grasp of the concept of how a binary tree is implemented.
As mind-boggling as recursion has a tendency to be at times, the class designed around recursion was just as mind-boggling as I expected. Going through the exercises in labs, I managed to gain a pretty solid grasp of what was going on, but the whole system of having trees contained inside of nodes of trees and having an entire tree represented in a single node was kind of a weird concept to wrap my head around. By the end of the lab, I had built-up the same relationship with the implementation of the binary tree as with the limit in calculus and particle-wave duality of electrons in physics: I could solve problems with them and I accepted that they existed and were valid, but the concepts didn't seem to fit quite right in my head. Hopefully, with time and more practice, I'll gain a stronger grasp of the concept of how a binary tree is implemented.
Week 7:
To the TA marking this, please mark my summary of object-oriented programming concepts. Thank you.
Week 6: A Summary of Object Oriented Programming Concepts
Object oriented programming is a type of programming language that revolves around storing data in "objects". These objects have properties and behaviour that can be accessed and utilized when solving problems pertaining to these objects.
To better communicate how object-oriented programming actually works, let's take a look at an example of an object: a human. Humans have names, titles, addresses, phone numbers, and countless other instances of information that describe something about that particular human. Depending on what exactly you wanted to do with your human, you'd need different information. An employer would want a degree or diploma and a criminal record, if any, while a school looking at prospective applicants would want an academic transcript. A potential significant other would be more interested in this human's interests, hobbies, and, well, knowledge of a criminal record definitely wouldn't hurt.
Working with these human objects involve needing the ability to access all of this information (ideally in a quick, convenient manner) and to update the information as our human conducts his life. In addition, though all humans have certain characteristics in common, some will require keeping track of additional information that other humans won't need to deal with. For example, a student will need a list of courses they're enrolled in, the name of the school they attend, and an academic transcript, to name a few things. In contrast, a carpenter would have absolutely no use for those things to help him or her perform as a carpenter. A doctor, a lawyer, and a teacher yet have different sets of data that they require that would lack any application or meaning in a different profession. And yet, all of these people need to keep track of basic information like their names.
Object oriented programming addresses all of these issues and more through implementing concepts like inheritance. You can create a general class that stores all the general information that every human needs, while creating subclasses for specialized humans that have specialized needs. You can easily access and modify all of this information to solve the various problems that arise with various different types of humans. An additional strength with OOP is that, without even looking at any of the source code of the super class, you can simply use the methods in the super class to create specialized methods by amalgamating the more general super class methods.
Object-Oriented programming is a powerful paradigm that provides a simple, straightforward way to translate complicated real world issues into code.
Thursday, 12 February 2015
Week 5: Tracing Recursion
Recursion, my old friend. How nice it is to see you again.
To be completely honest, recursion is one of the reasons that I love computer science so much. Though it can be tricky to learn and a bit of a headache to trace, especially if what the program is supposed to do isn't given, well-written recursive code has a unique finesse. I see certain recursive solutions to problems as works of art. I think the way they can simultaneously begin, go through, and finish problems by utilizing copies of themselves is kind of beautiful.
With that said, this week put emphasis on what a headache it can be to trace memory going in and out of recursive functions and methods. Fortunately, mostly due to having some experience dealing with it from high school, the examples of tracing we've been given in class haven't been too tricky. As such, it falls into the little oddball category of schoolwork alongside 11th grade trig identities in math and 12th grade Hess's law problems in chemistry; puzzles that are weirdly kind of fun to do. I have a feeling that the recursion traces to come later in the semester are going to have me pulling my hair out, but the tracing I've done this week has kind of felt like solving puzzles. Not that I'm always doing them in my spare time, but it's been a pleasant re-introduction into a subject I haven't seen for over a year. In particular, I've found the method of substituting back known cases incredibly helpful in a subject that I had a decent bit of trouble with when it was first introduced to me.
Tuesday, 3 February 2015
Week 4: Over the Past Few Weeks
A little late, but better late than never. I've successfully survived my first month back from the winter break, which isn't really an accomplishment because all my courses are half-year courses and therefore all started from scratch when I got back in January. Nonetheless, I've made it through the initial couple of assignments and labs and quizzes and the torrential wave of midterms is almost upon me.
My main impressions of the first few weeks, at least with respect to CSC148, are fairly positive. Having gone through AP Computer Science in high school in both grades 11 and 12, CSC108 in my first term was basically all review. Due more to the subject material than any fault of the lecturer, I found myself frequently not paying attention in lecture and instead choosing to hammer through the course work while he spoke. In CSC148, while I admit I'm still guilty of typing these slogs and doing lab work while sitting in lecture, more frequently than not I find myself intrigued and drawn into Danny's lectures. Everything in 148 in the first few weeks have still been review - I've dealt with inheritance, classes and sub-classes, and recursion in high school, but seeing Danny explain the concepts has been really helpful in solidifying concepts that I hadn't really digested fully in high school. The labs have also been a pleasure, partially because the Bahen Centre for Information Technology has to be my favourite building on campus and I love having class in it. I occasionally crash one of my friend's labs to study, and I've made it a goal of mine to have a lab of my own in Bahen by fourth year.
All in all, the first weeks of CSC148 have been a pleasure and I look forward to the weeks to come.
My main impressions of the first few weeks, at least with respect to CSC148, are fairly positive. Having gone through AP Computer Science in high school in both grades 11 and 12, CSC108 in my first term was basically all review. Due more to the subject material than any fault of the lecturer, I found myself frequently not paying attention in lecture and instead choosing to hammer through the course work while he spoke. In CSC148, while I admit I'm still guilty of typing these slogs and doing lab work while sitting in lecture, more frequently than not I find myself intrigued and drawn into Danny's lectures. Everything in 148 in the first few weeks have still been review - I've dealt with inheritance, classes and sub-classes, and recursion in high school, but seeing Danny explain the concepts has been really helpful in solidifying concepts that I hadn't really digested fully in high school. The labs have also been a pleasure, partially because the Bahen Centre for Information Technology has to be my favourite building on campus and I love having class in it. I occasionally crash one of my friend's labs to study, and I've made it a goal of mine to have a lab of my own in Bahen by fourth year.
All in all, the first weeks of CSC148 have been a pleasure and I look forward to the weeks to come.
Wednesday, 21 January 2015
Week 3: Why do geeks need to write?
In ninth grade, like many other ninth graders, I read what is sometimes heralded as the greatest love story of all time: Shakespeare's Romeo and Juliet. At the time, I spent the entire second half of the play gritting my teeth in frustration as a simple miscommunication resulted in the completely preventable deaths of two (mostly) innocent teenagers. I didn't realize it at the time, but this would become a recurring theme that would come to spring up in my life time and time again. From my own ill-fated grade 9 relationships to hearing the sound of my parents scream at each other reverberate through my house, I began to realize that almost every problem that creates friction between or within people arises as a result of a simple failure to communicate properly. With the modern advent of social media and popularization of smart phones, people struggle just as much to communicate to each other exactly what it is they're thinking and feeling.
Of course, it doesn't help that an alarming number of individuals who work in technical fields seem to be under the impression that they don't need to be able to write. "I'm in sciences!" they exclaim, "Not in those silly humanities. I haven't touched an essay since high school. Essays are lame and for the weak. What I do is the only real work in academia." And though they're right in that it's the work of scientists and engineers that have resulted in the massive technological advances we've undergone throughout all of human history, they miss a rather important point. There's a reason that essays and writing are taught in school; a reason that goes beyond looking for the themes that exist in literary works throughout history. The reason is that the fundamental principle behind an essay, the idea of communicating an idea through use of writing, is the catalyst that resulted in humans dominating over all other species on Earth. Communication and language is what led to humans banding together and forming societies. Communication helped us realize that while divided, we fall, but together, we conquer. Without the power of writing, humans would never have been able to come together and build airplanes or skyscrapers or cities. We'd be reduced to simple hermits, making the same discoveries independently, completely unable to build upon each others' work or create any sort of comprehensive body of knowledge.
So, why do geeks need to write? Simply put, writing brings out the fullest potential that humanity as a whole possesses. It allows us to blast through the limits we face as individuals and become something so much more as a society than the sum of us as individuals.
So, why do geeks need to write? Simply put, writing brings out the fullest potential that humanity as a whole possesses. It allows us to blast through the limits we face as individuals and become something so much more as a society than the sum of us as individuals.
Subscribe to:
Posts (Atom)