How to Code: Complex Data Pt. 2
I left off describing what I learned in the first half of the HtC Complex Data course offered by UBC on edX. While I completed the course back in November, I never got around to summarizing my highlights. I learned a lot from this course. Not only did I learn a lot of helpful programming paradigms, but I also learned “how to learn” and how to push myself beyond perceived limits.
Shortly after finishing the Sudoku solver portion, I felt really overwhelmed by the increase in pacing. I could follow along with the videos, but I didn’t feel confident or comfortable in my own abilities. I unenrolled from the course and locked my old files. I decided to start fresh, go a bit more slowly, and really try to absorb as much as possible. Recompleting the first few weeks was much easier the first time around, then I started to struggle in Abstraction again. My number one issue was not keeping active track of data types, especially in the abstract fold functions. Coming up with a signature took me longer than solving the actual problem:
;; (String Integer Y -> X) (X Y -> Y) Y Element -> XI just kept doing the same task over and over, with more focus each time until I was able to rewire my brain.
;; the abstract fold function for element
The beauty of all these accumulators, is that they’re written in
local definitions, so the outer function doesn’t know or care.
Graphs are an even more abstract type of data. The example given is like a house, you have many rooms which connect to each other in different ways. How can you traverse all the rooms without cycling in an infinite loop? Well you’ll need a Worklist Accumulator to keep track. The representation on graphs in Racket is strange and can take some getting used to, and requires we graduate to Advanced Student Language.
Graphs are pretty cool, and are important for the … Final … Project!
The final project of this course is a two-part problem. The first problem requires you to solve a twitter-like problem with followers. I didn’t have too much trouble completing this one, especially after reviewing the Graphs module. Part two is a more difficult challenge: given a list of TAs with their availabilities, can you fill a shift schedule? This problem incorporated a lot of things learned in the course. I’m not going to give anything away, but I really enjoyed working on (or at least solving) the problem.