Harvard CS50: Intro to Computer Science

Harvard CS50: Introduction to Computer Science

This course is a part of the Bridging Module for my Data Science Master's.

1.  Course Description
2.  Why Take This Course?
3.  My Review
       •   Course Overview
       •   Timeline
       •   Is It Worth the Price?
       •   Learning C
       •   How Challenging is It?
       •   Addressing the PHP Haters
       •   Closing Thoughts


Course Description

From the course website:

"This is CS50x, Harvard University's introduction to the intellectual enterprises of computer science and the art of programming for majors and non-majors alike, with or without prior programming experience. An entry-level course taught by David J. Malan, CS50x teaches students how to think algorithmically and solve problems efficiently. Topics include:

  • Abstraction
  • Algorithms
  • Data structures
  • Encapsulation
  • Resource management
  • Security
  • Software engineering
  • Web development

Languages include C, PHP (edit: Python replaces PHP in Fall 2016), and JavaScript plus SQL, CSS, and HTML. Problem sets inspired by real-world domains of biology, cryptography, finance, forensics, and gaming."


Why Take This Course?

A introductory level course in computer science is a requirement for virtually all undergraduate computer science programs. Completing this course, along with the other two courses in my bridging module, means I will have completed a standard first-year computer science curriculum, plus the full mathematical and statistical core.


My Review

April 12, 2016

View this entry on Medium

High praise for Harvard’s online introduction to computer science course is not difficult to find. "It’s a cultural touchstone, a lifestyle, a spectacle," says The Harvard Crimson. YouTube CEO Susan Wojcicki says CS50 changed her life. CS50 receives near perfect scores across the board on CourseTalk, Class Central, and edX. Here are my thoughts:

Course Overview

CS50 is a true, comprehensive introduction to computer science. The course is taught by the vivacious David Malan and hosted on edX. There are 13 weeks of instruction with 8 mandatory problem sets (psets) and a final project:

  • Week 0: Binary. ASCII. Algorithms. Pseudocode. Source code. Compiler. Object code. Scratch. Statements. Boolean expressions. Conditions. Loops. Variables. Functions. Arrays. Threads. Events.
  • Week 1: Linux. C. Compiling. Libraries. Types. Standard output. pset1
  • Week 2: Casting. Imprecision. Switches. Scope. Strings. Arrays. Cryptography. pset2
  • Week 3: Command-line arguments. Searching. Sorting. Bubble sort. Selection sort. Insertion sort. O. Ω .Θ. Recursion. Merge Sort. pset3
  • Week 4: Stack. Debugging. File I/O. Hexadecimal. Strings. Pointers. Dynamic memory allocation. pset4
  • Week 5: Heap. Buffer overflow. Linked lists. Hash tables. Tries. Trees. Stacks. Queues.
  • Week 6: TCP/IP. HTTP. pset5
  • Week 7: HTML. CSS. PHP (edit: Python replaces PHP in Fall 2016). pset6
  • Week 8: MVC. SQL. pset7
  • Week 9: JavaScript. Ajax. pset8
  • Week 10: Security. Artificial intelligence.
  • Week 11: Artificial intelligence, continued.
  • Week 12: Exciting conclusion. (Spoiler alert: montages, CS50 Family Feud, cake!) Final Project

There are two lectures per week. Each lecture is 50ish minutes long. Each week has a series of shorter videos as well:

  • Walkthroughs: 1–3 minute videos of David Malan walking you through the lecture’s sample code at a slower pace
  • Section: 5–30 minute videos of a Harvard teaching fellow explaining lecture concepts in depth
  • Shorts: 5–15 minute videos of other CS50 staff members explaining lecture concepts with additional (and sometimes quirky) examples (see video below)

Problem sets are “programming assignments that challenge you to apply concepts to problems inspired by real-world domains.” They are marked by an automated grading system. Your overall mark for a problem set is the fraction of tests that your code passes (1.0 = 100%).

Timeline

There is no to-the-hour estimate from Harvard. They do state problem sets take 10–20 hours to complete. With 8 problem sets, ~5 hours of video content per week, and a final project, a ballpark estimate would be somewhere just north of 200 hours. It took me 200 hours and five minutes, as tracked by Toggl.

I spent like a day and a half figuring out how web hosting works and editing this stupid video for my final project, both of which aren’t required, so 185 hours or so is probably a more reflective number.

Is It Worth The Price?

The course is free, so yes. You have access to all of the materials and grading at no cost. Probably the best undergraduate computer science course in the world is available to anybody who has an Internet connection. That’s still so cool.

You can pay for a verified certificate, which currently costs $90, if you’d like it for personal or professional reasons.

Learning C

The first 6 weeks of Harvard CS50 are spent in C, a language notorious for its complexity. Seems like a curious choice, no? Even though I likely won’t use C much going forward, I am very glad it was the language of choice for this reason:

The advantage to knowing C is that you have a very good idea of how a computer works. Not just how your programming model works, but how memory’s laid out, and suchlike. Knowing C also lets you appreciate how much less work you have to do in a higher level language … and the cost involved in working in that higher level language.
— Frank Shearar on Programmers Stack Exchange

The CS101 equivalents from Udacity and MIT (via edX) both use Python. Nick Parlante’s Stanford course uses C, but the difficulty level of that course isn’t on par with the aforementioned three.

How Challenging is It?

It’s tough, but it’s good tough. At no point did I feel lost. The course is well-structured and there are tons of additional resources. Basically every social media platform you can think of has an official CS50 community — I found Reddit and Stack Exchange the most useful.

The CS50 staff say that the pointers section of the course is the hardest and they are right. You intimately deal with pointers and allocating memory in pset5 and pset6. Mental gymnastics are required. Finally figuring out pointers is probably the thing I am most proud of coming out of the course.

The 10–20 hours for each problem set is accurate. Your code won’t work and you will get frustrated (especially because half of the course is in C), but frustration is good. Frustration conquered is learning.

Addressing the PHP Haters

Edit (August 2016): Fall 2016’s edition of CS50 replaces PHP with Python, another high-level programming language, which nullifies the following concern.

I almost didn’t enroll in CS50 after reading this popular Quora answer regarding CS50 teaching web development using PHP:

Trust me. You DO NOT want to spend your time learning PHP in 2014.
— Anubhav Sinha on Quora

That may be true, but it’s not particularly relevant to the decision to take this course. There is only one week of lecture content and two problem sets that use PHP. You do not dedicate a significant amount of time to it. The educational function of PHP is to demonstrate how higher-level programming languages are useful.

One of the reasons why they do use PHP in CS50 is because it is heavily inspired by C. By week 7, students have a solid C foundation. Picking up PHP at that point isn’t difficult because of the syntactical similarities.

Bottom line: do not let two weeks of PHP deter you from this one-of-a-kind learning experience.

Closing Thoughts

I’m having a hard time describing CS50 without sounding hyperbolic. The course was just so damn good. This piece in The Harvard Crimson is ridiculously dramatic, but it’s so true. The content is engaging. David Malan is too good at his job. The production value is absurd. Honestly, go check out a lecture for the production value alone. Fall 2016’s edition will be even crazier: they’re shooting lectures in 6K and VR.

I have now completed CS50, Stanford CS101, and half of Udacity CS101 and without question Harvard’s introduction to computer science is my favourite. A few weeks post-graduation, I’ve already had some legitimate nostalgia. It was an experience.

Rating: ★★★★★