CS371p Spring 2022: Kaustub Navalady: Final Entry
- test first, test during, test after; test, test, test
- when designing algorithms, demand the weakest iterators (e.g., bidirectional vs. random access)
- when designing containers, provide the strongest iterators (e.g., random access vs. bidirectional)
- build adapters on top of containers and iterators
- do not use new and delete; use allocators instead
- always look for reuse and symmetry in your code
- collaboration is essential to the quality of your code and to your well-being in producing it
- refactor, refactor, refactor
- make your code beautiful
How well do you think the course conveyed those takeaways?
I think the course definitely covered all of these takeaways really well. We had practice writing unit tests and acceptance tests for each project, so this gave us practice with testing. We also learned about the five types iterators in C++ and their various strengths and uses. We also covered the various containers and adapters in the C++ STL. New and delete don’t seem to be the way when we have tools like allocators and smart pointers. Also I got good practice with pair programming for all the projects for collaboration.
Were there any other particular takeaways for you?
I also enjoyed learned the various reference semantics and initialization semantics in C++. I enjoyed how the class compared C++ with Java and seeing how C++ tends to do the opposite of Java language design wise. C++ tends to disallow programmers from writing inefficient code (like disallowing push_front in a vector, or indexing a list), whereas Java allows it.
How did you feel about cold calling?
I really enjoyed the cold calling as it kept me focused and let me confirm my understanding of the material. It was also low stakes, so there was no pressure if you didn’t know the answer.
How did you feel about specifications grading?
I think the specifications grading is a good idea, because it makes you do all of the work, with some slack with virtual tokens. I feel like the thresholds could be tweaked slightly, as for example, 1 exercise is the difference between an A and a B.
How did you feel about help sessions and office hours?
I attended the help hours once, and it was helpful for project questions.
How did you feel about the support from the TAs?
The TAs were great this time around. Definitely would have them again. I also enjoyed being able to communicate with them over Discord, rather than Ed discussion.
You should have read five papers that describe SOLID design: Single Responsibility, Open-Closed Principle, Liskov Substitution, Interface Segregation, and Dependency Inversion. What insights have they given you?
The main takeaways I got were that you should program for a fixed abstraction, but different implementations, so that you can have robust and flexible code. This can be done using abstract classes and dynamically bound methods. You want to write code that can be changed easily without breaking code in a large number of places.
You should have read two papers that advised minimizing getters and setters. What insights have they given you?
I think the idea is good, in that we basically want to make a class do whatever behavior is needed instead of asking it for data and acting on that data. This is because the underlying data/implementation can change, and this will break any code that is using getters. However, in practice, it makes sense to have getters at times as otherwise it leads to convoluted workarounds simply to avoid a getter.
What required tool did you not know and now find very useful?
I found Google Test (gtest) for C++ unit testing to be extremely useful, especially for test-driven development.
In the end, how much did you learn relative to other UT CS classes?
I would say a learned a similar amount to other UDEs, in that I learned a good foundation for C++. The class was not conceptually intense (like OS or other systems classes), but it was nice to learn the nuances of C++, which will help me further pursue the language confidently. This class felt kind of like CS 314, but for C++.
Give me your suggestions for improving the course.
I think for the short time duration of the course, it does what it intends to do well (i.e., teach the fundamentals of C++). However, I think it would be nice to learn OO design patterns like singleton, factory, etc. As many others have mentioned, this class is more “Foundations of C++” than “Object-Oriented Programming”. Otherwise, Downing is an amazing lecturer.