CS371p Spring 2021: Week 7

Samuel Turner
2 min readMar 7, 2021

Blog Post 7

What did you do this past week?

I spent most of my time working on a take-home exam for the Algorithms class, the voting project, and another project I have for Networks. I also sprained my knee so I was spending most of my days trying not to move it too much.

What’s in your way?

Home work. The combination of assignments being delayed from the snow days plus the upcoming spring break has my next week packed with deadlines.

What will you do next week?

I will finish up the Networks class project as well as work on various assignments that will be assigned/due throughout the week in my classes.

If you read it, what did you think of the Open-Closed Principle?

I think it is very important to follow. Code becomes vary hard to maintain and use if their logic/dependencies leak into the code that uses them. Code that follows the open closed principle on the other hand is usually very clean and flexible. It was also very relevant with the Ballot/Candidate/Voting classes we made for the voting project. It makes me consider whether or not I could have done a better job future-proofing them.

What was your experience of arrays, iterators, and algorithms? (this question will vary, week to week)

I had not used them in C before. In particular iterators were odd for me. There are the different flavors that were mentioned in class (input, output, forward, bidirectional, and random access), but just in general having to use an iterator to gain access to certain elements is not something I have had to do up till now. I am used to being able to just index into a list-like data structure. I caught myself more then once trying to de-reference with [] when using them in the voting project.

What made you happy this week?

My sprained knee is getting better. I still cannot bend it fully, but it is well enough that I can walk around without any problems.

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

Another commonly-known tip, but testing code regularly. I fall into the habit of creating something simple and not testing it thinking I have no need. Before I realize I have written many lines/methods and haven’t tested them even once. I did this for the voting project and it made debugging take way longer than it should have.

--

--