Post-task self check

Written by Julie Zelenski

As you vanquish each CS107 assignment and lab, a little celebration is definitely in order, but once the excitement dies down, take a moment to reflect on how far you've come and what new knowledge and skills you have to take forward. To help you gauge your progress, for each assignment/lab, we identify some of its takeaways and offer a few thought questions you can use as a self-check on your post-task understanding. If you find the responses don't come easily, it may be a sign a little extra review is warranted. These questions are not to be handed in or graded. You're encouraged to freely discuss these with your peers and course staff to solidify any gaps in you understanding before moving on from a task. They could also be useful as review before the exams.

Assign0: Unix

You now have your environment configured and should be starting to feel comfortable with the command-line interface, can navigate the filesystem, edit files, and generally get around in unix. Off to a great start!

Lab1: Bits and integers

The takeaways from lab1 should be proficiency with bitwise operations, constructing and using bitmasks, and a solid grasp on the representation of unsigned values as a binary polynomial and signed values in two's complement.

Assign1: Bits and integers

Congrats on your first complete C programs! At the end of the quarter, many students recall this first assignment as one of the tougher ones not so much due to code/algorithm complexity, but because of the effort needed to become facile using new tools in an unfamiliar environment and acclimating to through the sparse, unforgiving world of C. Celebrate this important milestone and remember the investment you make now in gaining proficiency will pay off throughout the quarter.

Lab2: C-strings

You should be continuing to build up your gdb and Valgrind repertoire and learning your way around the string.h functions and manipulating C-strings as raw arrays/pointers.

Assign2: C-strings

You just wrote your own implementation of a standard Unix utility program and improved version of a standard library function. That's a pretty darn impressive accomplishment, especially so given only two weeks of exposure to C and Unix -- wow!

Lab3: Pointers and arrays

You should be continuing to build up your gdb and Valgrind repertoire and becoming skilled at reading and writing code with heavy use of with pointers. Arrays and pointers are ubiquitous in C and a good understanding of them is essential.

Assign3: Pointers and arrays

Lab4: Void*

You are getting your bearings in the world of raw memory. You can make sense of the cryptic syntax uses for function pointers. You know how to use the type system to your advantage wherever you can, but also how to work without it where you must. You know the care required to make a proper call to memcpy/memmove, exactly where and why you need a typecast, and have increased vigilant about using the correct level of indirection.

Assign4: Void*

Your command of memory management is now unstoppable and you have a rock-solid understanding of the client use of a void* interface and the generic implementation. The critical mastery is correctly passing/receiving the void*s flying around: what level of indirection to use, what typecasts are needed, using * and & in exactly and only the necessary places. You should know without question how to determine the necessary level of indirection and correctly apply it. It's also valuable to understand and be able to reason through the consequences of getting it wrong.

Lab5: Floats

You have been introduced to floating point and understand the representation as a form of "binary scientific notation". You should have a feel for the inherent compromises in this system: which values are representable, which are not, the gaps in the floating point number line, and a general sense of the rounding/approximation to expect from a floating point calculation.

Assign5: Floats, assembly

At this point, you should be feeling less bewildered by reading assembly and building up your skills with the tools to disassemble, trace, and examine programs at an assembly level. You are ready for the famous binary bomb!

Lab6: Assembly

You now have tools for disassembling object files and have been introduced to the debugger commands used at the assembly level. The hands-on practice relating C code to its compiled assembly and reverse-engineering from assembly to C is great preparation for your next assignment.

Assign6: Assembly

After reverse-engineering the bomb, the assembly skills of CS107 students are unstoppable!

Lab7: Stack

This is one of my favorites among the labs -- lots of neat exercises to explore! Having learned the gdb commands to dig around in the stack frames and being able to relate the contents of the stack to the runtime program state is valuable insight when debugging.

Lab8: Optimization

Learning how to use Valgrind callgrind is another key tool to add to your developer arsenal. Your killer reversing skills are just what is needed for examining the generated assembly and identifying gcc's cool transformations to make code run faster.

Assign7: Heap

A former student likened heap allocator to a "victory lap" -- a chance to put your hard-won expertise to work and enjoy the triumph of seeing what you are now capable of! Success requires heroic skills with void* pointers, raw memory manipulation, assembly, optimization of both code/memory, and deep proficiency with tools. You have much to be proud of!