CS371p Fall 2020: Nathan Jackson
By: Nathaniel L Jackson
Tags: Programming, Computer Science, Object Oriented, C Plus Plus Language

What did you do this past week?

This past week I started working on the Darwin programming assignment. It’s a great exploration of the object-oriented design techniques we’ve been learning in class. The main challenge is to design three classes that interact with each other without using getters and setters. Ultimately, this fits the LSP model wherein classes send requests to each other; the implementation details is unnecessary to the requesting class, it only cares that it is getting what it is expecting. This allows for future changes to the requestee class implementation that don’t have rippling effects on the rest of the code.

As of Sunday 11/1/20, I’ve written code for my Creature and Species class.

What’s in your way?

The only thing in my way at this point is to first write code for the Darwin class (handles the board and some actions that Species cannot perform) and to write unit tests. From there, it’s a matter of passing student and instructor test cases, then getting the repo ready for submission.

What will you do next week?

Tomorrow I’m planning to write Darwin and the unit tests for all three classes. Then Tuesday I’ll write the input handling code and test my implementation against the HackerRank submission test cases. After that, the rest of what I outlined as things in my way.

If you read it, what did you think of The Interface Segregation Principle?

I would say the ISP puts a name to the general principle of OOD that I had been keeping in mind: avoid fat interfaces whereby the child classes only use distinct subsets of the interface yet have to implement all the virtual functions. This is problematic since any changes to the interface will have to be accounted for in all descendant classes even if they don’t make use of those changes. The solution to reduce coupling between otherwise isolated clients is the ADAPTER pattern, where you can delegate interactions with an interface through an object handler or through multiple inheritance, where a class can extend two or more interfaces that it needs, rather than having one class inherit from the others. Overall, I think it’s the most important and clearest OOD principle we’ve covered in this class thus far.

What was your experience of continuing to implement std::vector? (this question will vary, week to week)

I would say that implementing the std::vector class has continued to be helpful for my understanding of general class design in C++. I did not know what copy constructors or copy assignment operators were before last week, but after this past week I have a fair knowledge of both!

What made you happy this week?

In this week of Nathan’s baking exploration, I made jam thumbprint cookies! These are thin butter cookies that sandwich a layer of reduced raspberry jam. This made me (and my roommate) extremely happy this weekend. We also baked the little cut out cookie circles (3/4" in diameter), which were surprisingly better than the jam cookies!

What’s your pick-of-the-week or tip-of-the-week?

With the election coming up in two days, my pick of the week would be the FiveThirtyEight election forecast tool. There will be a lot of polls coming in the next two days, but it’s important to take them all into account, rather than let one outlier dominate your perception of the race at hand, and FiveThiryEight’s models do just that. I’m simultaneously optimistic and nervous for Tuesday, and hopefully I will know what happens by the time my next blog post is out.