CS371p Spring 2021: Kushal Pachchigar #6

What did you do this past week?
I worked on the next project for this class — voting. I implemented the simplest solution first, passed 1 of 3 hackerrank tests and generated more test cases as is the best practice. I then implemented the less simple solution discussed in class and got all the hackerrank tests to pass.
What will you do next week?
I still need to write the unit tests for this project, and follow the workflow guidelines to run the cppcheck, format and comment the code. I’ll also be going to the office hours to clarify on the format of writing multiple classes and including them in the main file.
If you read it, what did you think of the Single Responsibility Principle?
The reading about Single Responsibility Principle was interesting. I didn’t think about responsibilities as defined in the readings, but now that I’m made aware of it, I will hopefully consider this when writing more code in the future.
What was your experience of Voting and consts?
The Voting project seemed a bit confusing at first. But after going over it in class, it seemed straight forward. Implementing it was also a little tricky. It would have taken a long time for me to realize that using classes would be better than map or other data structures, but talking about it in class helped me figure out a plan on how to go about implementing this project. The different stories with consts and pointers helped me better understand not only consts, but also pointers.
How did you fare in the storm?
My apartment didn’t had electricity for almost 4 days, but thankfully one of my friend’s did and also had an extra room for me to crash at. Water was an issue for just a couple of hours at his place, but it turned out just fine for us. Other than that, we had quite a bit of free time since all the deadlines were extended and we enjoyed the week talking long walks in the snow!
What made you happy this week?
Passing all hackerrank tests for this project made me really happy as this would be one less thing to worry about for next week. I have quite a few projects and homework coming up by Friday of next week.
What’s your pick-of-the-week or tip-of-the-week?
tip-of-the-week: For voting, if using a custom class, it is very important to check how you’re passing it around various methods (by reference or by value). For me, it was very frustrating when I kept on losing class variable values in another method.