CS371p Spring 2022: Week 6

Kaustub Navalady
3 min readFeb 28, 2022

What did you do this past week?

This past week I worked on implementing a multi-threaded and an event-loop based client application for my Computer Networks class. I had to revisit some synchronization primitives (and corresponding concurrency bugs), so it was a nice refresher of some Operating Systems content. I also finished my Data Mining project on implementing a K-Nearest Neighbors and Naive Bayes classifier. Finally, I also got started on the Voting project with my partner, and we are trying to follow a TDD workflow.

What’s in your way?

Nothing much is in my way. I’m keeping up rather well in my classes, but the weather has definitely not been the best this week. It being so cold outside made the trips to Greg and GDC tremendously unpleasant.

What will you do next week?

I will finish up the Voting project, the Networks project, write an argumentative essay for my Syntax class, and I also may get started on the next Data Mining assignment.

What did you think of Paper #6: Open-Closed Principle?

It was a good paper that advocated for the use of abstract base class interfaces and derivative class implementations as needed. The paper did a good job illustrating the issues that arise when using a standard procedural strategy for create a class/module. Furthermore, the reasoning behind common programmer “best practices” like encapsulation of instance variables and the avoidance of global variables became more apparent.

What was your experience of arguments, returns, and consts?

I have used normal values and pointers as arguments and return values before, but it was interesting to see the utility of references. For one, when passing by address (pointer), the function must be wary that the pointer could be null, i.e., one could pass 0 as a valid argument to a function requesting a pointer. If one forgets to check for NULL, this would manifest as a run-time bug somewhere. However, if you use references as arguments, you cannot pass 0 as an argument because references need an l-value, so such an error would be caught at compile-time. It was also interesting to see the concept of a dangling reference.

I also enjoyed the in-depth coverage of the const keyword and seeing how it has different semantics depending on where it is in the type declaration, and whether it is modifying a value, pointer, or reference. The discussion also clarified why in C++ people often pass arguments by const reference. The big takeaway is that using such declaration can help catch bugs at compile-time rather than run-time, which is much more expensive of a mistake.

What made you happy this week?

Rumor on Reddit this past week was that Halal Bros was reopening again, and I couldn’t believe it when I saw that it really did. I got some food there (great quantity) with some of my friends, and it really hit the spot.

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

My tip of the week is that if there’s some technology that you want to learn and it happens to be open-source, a great way to gain a deep understanding of the technology is to contribute to that open source repository. For example, if you wanted to learn how Docker really works, you could try contributing to the repo on GitHub. It might seem intimidating at first, but the repo maintainers often have “Help Wanted” or “Easy First Task” issues meant for people inexperienced with the code base. Take a look of some of the issues linked below:

Find a repo you like and start contributing! It’s a great way to network, get practice, and it’s a great talking point with recruiters. P.S., I got these tips from the Virtualization class taught here at UT.

--

--