CS373 Fall 2021: Week 11

Ethan Tan
3 min readNov 7, 2021

Week 11

What did you do this past week?

Most of it was spent between homework for two of my classes and a project for another.

What’s in your way?

The current project I’m working on is very unclear in what is actually expected, making it difficult to figure out what to do or what was intended.

What will you do next week?

I’ll need to finish weekly homework and work on phase 3 of the IDB project.

If you read it, what did you think of Paper #11: Getters and Setters?

I have not yet read this, this semester at least. I’ll hopefully be able to get to it later.

From what I remember last semester though, getters and setters are discouraged because they expose implementation details that tend to be irrelevant to a user of a class. Exposing setters can also be particularly dangerous since variables may be changed unexpectedly.

What was your experience of relational algebra, select, and project?

Relational algebra is a neat way of formalizing operations on databases. I think for our purposes and from the way the course is being taught, relational algebra is simply an API for working with databases. I assume the formalism of relational algebra makes it easy to compose operations and prove correctness.

Select and project are primitives of relation algebra that are very basic. This makes them very nice tools to build other operations on. Select is analogous to a filter on rows, while project is analogous to a filter (of sorts) on columns. This allows us to take subsets of data by both row and column, giving us the ability to find information while removing what we don’t need.

What made you happy this week?

I’m too busy to be happy. Check back Thanksgiving break.

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

You’ve probably heard of it somewhere, somehow, already — but if you haven’t, check out rust. It’s my first time actually using it, and it has some pretty cool features. It has a strong type system, which is always a plus for me. Errors are much easier to avoid when the compiler catches them for you, and type-checking is a huge part of that. Speaking of the compiler, the error messages are among the best I’ve seen — clear, descriptive, and even comes with suggested fixes in some cases. I haven’t needed to resort to google to resolve build errors yet.

Much of rust’s uniqueness comes from it’s built-in support for ownership. Much like unique pointers in the C++ standard library, most values in rust are by default owned by a single context, with explicit syntax of copying, moving, and borrowing values.

As a tie-in to what we’re learning in this class, rust also appears to have pretty robust support for iterators. Like Python, rust iterators are lazy, and are even easier to use functionally. That is, we can compose operations on iterators like map and filter using familiar method call syntax.

--

--