Today was a long day. Yesterday, I finished reading and completing exercises for all of the chapters in the CompTIA Security+ training materials I'm getting through WGU, and today I spent about 4.5 hours taking practice tests. I did 4 - 90 question tests and had repeat one of them to score above 90%. I then took a nice long break to eat at my favorite Indian restaurant (Spice King in Renton, WA, if you're interested), and when I came home I cranked through Systematic Program Design - Part 2 Sec. 4a & 4b.
I'm still discovering the style I want to use to communicate which courses I'm working on and how much time it is taking so bare with me if you're reading through the things I've written so far. Hopefully I'll find a consistent pattern I like that doesn't take readers too much time to parse though if you're just here for certain details.
I worked on these two sections for about 3.5 hours and if you read my last post you know that I decided to stop using C# and I finally downloaded Racket to complete the exercises for this course. It was pretty rough at first, as I anticipated, but I've seen enough now that the syntax for BSL is pretty strait forward, but I really got hung up on parts where I was supposed to use functions I saw in Part 1, but couldn't make the connection, since I wasn't using BSL in that part.
Section 4a starts by explaining arbitrary sized data, data whose size may be unknown at design time. The explanation of arbitrary sized data leads into teaching you how to define lists in BSL, and quickly jumps into using recursive templates to do things like add, count, and take the product of values inside of a list. If you're new to recursion, this section might take a while, and you may have to replay the videos a few times. I blasted through them at my usual 2x speed, but found myself referring back to them when I got to the practice problems.
Section 4b doesn't really offer many new concepts, but rather focuses on "[taking] a small but significant step in terms of the complexity of information we can represent as data". Essentially, this section is all about building a larger project out of all the pieces we've learned so far. It focuses heavily on using templates and using wishes, which I explained in my last post. This section focuses on emphasizing the importance of working through the HtDF recipe and how examples you create up front, will naturally help you produce a proper function. The practice problems in this section take up a lot of time, I only did the first problem, "Design the tuition graph bar chart function based on an alternative data definition for School", but the second problem "Design a world program that has an arbitrary number of spinning bears" is probably a bit more interesting.
As a side note, I remember reading a section of "Data Abstractions and Problem Solving with C++", a book I bought a while back, which walked though the Fibonacci sequence to describe rabbit reproduction rates and some other similar recursive ideas. I seem to recall this book making note that recursion is a valuable tool to have, but isn't always the right one to use. I was able to relate to this notion when I wrote a recursive function in section 4a to determine the largest value in a list of values.