CS373 Fall 2021: Week 7

Ethan Tan
2 min readOct 11, 2021

Week 7

What did you do this past week?

I finished up several assignments and phase 1 of the IDB project. I also had an exam that wasn’t too difficult. Other than that, just the standard busy week.

What’s in your way?

Lots of work, lots of stress.

What will you do next week?

I have an exam in two of my harder classes, so I’ll be worried about those until Wednesday. After that, I’ll work on the IDB project with my group and hopefully find time for a break.

If you read it, what did you think of Paper #7: Open-Closed Principle?

The open-closed principle makes a lot of sense. Code is a lot more durable if you never change it, so preventing change is the best way to ensure that. Furthermore, it forces you to write code that is more generic and can account for future additions, which makes adding on to the code base easier. The open-closed principle seems designed with object-oriented code in mind, and they do seem to go hand in hand — the use of abstract classes to separate interface from implementation seems hard to replicate in a non-OOP world.

What was your experience of operators and iteration?

After taking object-oriented programming last semester and the first half of software engineering, I’ve come to the conclusion: Prof. Downing really loves his iterators. What’s not to like? They’re a great abstraction for all collections and then some, are so commonplace that they have language support, are a beautiful demonstration of the open-closed principle, and in most cases are lazy as well! Iterators are a truly blessed addition to any imperative language. Although I must say my preferred pattern is still higher order functions like map and reduce, iterators are pretty cool.

What made you happy this week?

Pretty stressed, not too much joy here. Hope next week I’ll be able to take a bit of a breather after my exams.

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

Check out Go. It’s a neat little language with built-in support for concurrency, and working with concurrency in Go is both easy and fast — there’s neat and concise syntax for goroutines, Go’s lightweight version of threads, and goroutines themselves are impressively optimized. It’s hard to notice the extra overhead, even with many, many goroutines. Of course, it also has some downsides, like the lack of generics. Otherwise, it’s a really nice language to use when dealing with concurrent code.