Background: What is CS50, and why am I taking it

One big part of my journey to the center of data science has been a journey to the center of computer science. I'm a self-taught programmer, and I've now taken four CS courses in my life: an introductory undergrad CS101 course from looong ago, and three data science-centric CS courses through Harvard's Extension School.

The rest I've learned on the fly - which has been fun and whirlwindy - but it leaves me with some foundational, I think, gaps. Specifically, I want to focus on:

  • Data structures and algorithms
  • Networking

But, before diving into those two, I thought working through Harvard's (crazy popular) CS50 would be a great way to fill in a lot of general fundamentals. Also, it has some problem sets in C! Yay!

By blogging and "learning out loud", I'm hoping it'll motivate me to find the time to really crush through this and finish it up. It's 11 weeks of about ~2.5 hours of video and ~4-5 hours of problem sets per week. That's ~75-80 hours. Thanks to edx.org's instance of CS50X, everything's released at once, grading (seems to be?) automated, and it's free. I love MOOCs that let you set your own schedule and, if possible, just binge. That's been a lot easier for me to organize around than MOOCs that have enforced week-by-week marches. My schedule is lumpy! Some weeks are free, others are insane.


Week 0

Lecture

The first lecture - or, in compsci nerdery, the 0th lecture - was a fun, edutainment dazzlement of a few core facts: hardware (bits!) and algorithms (ripping up phone books!). What I love about the CS50 behemoth (and it is a behemoth - with merch, even) is that its "meta" - the way it's produced - is clever and fun. I love using their tools. Did they build their own video player?

Problem set

I didn't care for PS0. It was meant to be a gentle introduction to programming via MIT's Scratch, a GUI-heavy programming language for kids. I think this could be useful to demystify programming to someone who's never coded before; I'm not sure. It introduces the basic concepts of loops, conditionals, and variables. I found it a chore and rushed through it. Let's get to C!


Week 1

Lecture

This explored basic programming ideas with C. If you've programmed before, the ideas were the basics: loops and conditionals and syntax gotchas, and so on. The main takeaway I had was about compilers (which translate source code, written in C, into assembly language), clang and its many flags, and make.

There was also some fun stuff about floating point imprecision (bane of all my unit tests!) and overflow/underflow. Data types - such as (unsigned) ints, chars, floats, and so on - were introduced.

Problem set

This PS was our first in C - yay! It covered a couple basic programming tasks: "hello, world", drawing some ASCII art inspired by Super Mario, and either implementing a greedy algorithm for a change-making machine or a credit card checksum, uh, checker. This was all done on CS50's nice, cloud-based (containerized?) IDE. I found it easy ("hello, world"), medium (Mario), and pretty tricky (greedy algorithm). A good mix!


Week 1, continued

Lecture

My three main takeaways from this lecture were:

  1. Compiling as a four-step process: preprocessing, compiling, assembling, and linking.
  2. #include <some_c_library.h> as the C-equivalent to Python's import statements.
  3. Command-line arguments.
  4. Debuggers.

Okay, four things. Man, I wish I had known about debuggers back when I first learned to code! Yeesh. I relied (and probably still rely too heavily) on console.log()/print() statements, but debuggers offer much richer information about a program's current state, variable values in scope, and all that.

Problem set

Cryptography! So this was basically implementing the Caesar and Vigenere ciphers, something I had already done in Clojure. Still useful, though.


Impressions so far

The thing about CS50 is that the lectures are super slick but, even better, the problem sets are dense and challenging. I really love the problem sets!

I remember marveling at the well-designed problem sets of CS171, CS109A and CS109B: in all those courses, I had probably learned the most by going through the comprehensive and dense PSs. So I really like that! It takes forever - but, thankfully, CS50 offers "less comfortable" and "more comfortable" options. If I have time, I'll work through the "hard" version (e.g. the Mario ASCII art); if I have less time or feel pooped, I fall back on the "easy" version (e.g. the greedy algorithm - which was still kinda tricky!). Overall, I'm spending ~4 hours on the PSs - which is less than I used to spend on the (not free) Extension School classes (that would be more like 8-10 hours/week, oof).


This post is part 1 of the CS50 series:

  1. Starting CS50
  2. CS50 - Algorithms, pointers and malloc, oh my
  3. CS50 - Data structures achievement unlocked
  4. CS50: No more lectures 😭