Monday, March 30, 2015

My Final Impressions

I feel as if this post should be saved for after the exam, but alas, I'll write it in my last week here.

I know that if I didn't struggle with a just-being-diagnosed learning disability, I'd have had a much easier time this semester. However, that isn't the case so I must admit that this course was a bigger struggle than I thought it would be.

I'm good when it comes to understanding, I'm terrible when it comes to focusing to acquire said understanding. I know what I want to do with my life is work with computers. Move to silicon valley, where the weather is warm and I can work the way I want. However, doing this may be hard considering I'm just now learning of something that changed my grades for the worse and it might be irreversible. Sure, I can now let the university know what happened and I can get exemptions. But I'm going to be here longer. My youth is wasting away. That said, I sure as hell will still try.

CSC148 was good at illustrating to me, again, that I want to program. I love the feeling of programming and getting something to work. I just.. need some time to do so. I hope to go this exam session treats me well and that I can go on to next year in a computer science major. I love this field and want to do everything that I can to do well. That's why I went to the doctor's in the first place!

I suppose I should close with something a lot less personal and a lot more related to the course.

My favourite part of this course, by far, was learning efficient ways to approach problems. That's the best thing about this course. I hope to god I can continue on learning this sort of thing.

Sorting!

Sorting has always been a sore sport for me (ha).

Even in CSC148, I had a bit of an issue with sorting, and I had a hard time visualizing it in my head. However, looking at the sorting examples used in class and during the labs, I'm beginning to see how sorting works, even for abstract data structures such as trees. Recursive thinking is essential for sorting through objects that aren't straight forward lists or arrays. If the object contains other object, in order to sort the parent object, the sorting algorithm will have to go through the child objects and sort them relative to and with the parent object.

This leads to the runtime problems. Which sorting algorithm is the best for a certain data structure? Some algorithms go through a linear progression of elapsed time, whereas others may have an exponential time elapsed. I suppose this is why CSC165 is necessary.

Assertion and Unittesting

Now these are very interesting concepts, indeed.

Assertion is an efficient way of debugging in python. In it's simplest form, it returns a boolean that returns true if you assert that one thing is equivalent to another, and they are equivalent. Likewise, it will return false if the statements aren't equivalent. This is useful if you want to write a short program that analyses the output of another program. It's essentially a debugging tool so that you can run a program and see if it runs the way it is supposed to run.

Unittest is also a useful feature in python. It automates testing and allows for the testing of any given program when run. The useful if __name__ == '__main__' line allows the program to test an entire program when run. Instead of putting doctest into your program that clunks it up and doesn't do much, unittest allows for assertions and programs to run independent of the debugging and thus, keeps the original program clean and clutter free (hopefully).

Both are pretty useful items and I hope to explore them more.

The Test

With all tests in CSC148, we were allowed a cheatsheet with what we needed on it. While I have a pretty firm understanding of what was needed for the test, I decided to leave off a bit of code that ended up being worth 10 marks on the test. Oh boy, did I kick myself.

All in all, I would say I'm doing decently in the course. I'm not fantastic but I'm not failing. These blogs always slipped my mind and I'd have other things to do. However, I'm making an effort to look inward at each week's lessons and write a meaningful, but short, entry about each.

This week taught me that I should not delete things from aid sheets!

A Look at Linked Lists

Here's the thing, this is the concept that made me drop CSC148 in the fall. Linked lists, at the time, were a hard concept for me to grasp. I didn't understand how the worked because I feel like last semester, they didn't build upon recursive thinking properly.

Now that I have a better grasp of recursive thinking, Linked Lists are a little clearer to me. Of course, I'll have to study them pretty hard to do well on the final but I get the basic understanding now.

A linked list is a simple concept of a set of nodes that together make a "list". Of course, it's not a list in the sense that python recognises a list. Rather, a linked list has a first node, then the next node, which is a list. This occurs recursively, making it easy to access the first and last nodes of the list and making a more tree like data structure for programmers to use. The insertion and deletion of nodes is also made simple with a linked list.

Sunday, February 22, 2015

The Past Few Weeks

The past few weeks have been interesting, to say the least.

This blog post was supposed to be published three weeks ago but instead of publishing it, I saved it as a draft and left it. I'm a genius, I know.


My impression of the first few weeks was wonderful. Danny Heap is a fantastic instructor and I wish I were a better student toward him. With the introduction of object oriented programming and class based programming, I wish I could say I'm a good student and keeping up with everything. However, due to illness, it's been hard for me to keep up.

Though, I have been learning a lot! My understanding of programming is slowly changing from how to do things on a base level to how to approach a problem without a language, first. Object oriented programming is obviously the way professional programmers go about doing their jobs, so I can't wait to become more involved with this sort of thinking.

A Summary of Recursion

Ah, recursion. Its a fairly hard concept to grasp onto at first; it seems counter intuitive to any programmer first starting out with it. How can a function or program call upon itself? Wouldn't that create an infinite loop? Contrary to what most beginners, including me, thought, recursive thinking in programming is actually quite useful; it saves on quite a bit of redundant code and allows for programs that would not normally run without recursion.

Recursion, in short, is when a program calls upon itself to solve smaller instances of a larger problem. A good example of this is a program that wants to add up all of the numbers in a list of lists. The program can call upon itself using an if statement while calling the function 'isinstance'. With a variable set to 0 already in place, this function will look into all of the instances of lists in the object the program was called on and add the numbers to the variable. Thus, it will return a cute little integer or floating point number without all the hassle of redundant code.

I'm still trying to wrap my head completely around the concept. I've spent quite a bit of time going through recursive functions and tracing how they go about accomplishing their tasks. While not quite in the clear of understanding, I'm starting to see the light!

The light from my monitor, at least.