Syllabus

Instructor

David J. Malan ā€™99
malan@harvard.edu

Preceptor

Brian Yu ā€™19
brian@cs.harvard.edu

Description

Introduction to the intellectual enterprises of computer science and the art of programming. This course teaches students how to think algorithmically and solve problems efficiently. Topics include abstraction, algorithms, data structures, encapsulation, resource management, security, and software engineering. Languages include C, Python, and SQL plus HTML, CSS, and JavaScript. Problem sets inspired by the arts, humanities, social sciences, and sciences. Course culminates in a final project.

Class Notes

This spring version of CS50 is for undergraduate concentrators who were unable to take the course in Fall 2019. All students, including concentrators and non-concentrators, are encouraged to take CS50 in fall term instead. See cs50.harvard.edu/spring for differences between fall term and spring term. Students must register for and attend weekly class meetings on Tuesdays, 3pmā€“5:45pm. Instructor-led tutorials to be arranged.

Expectations

You are expected to

  • watch all lectures,
  • attend nine classes,
  • solve ten problem sets,
  • take seven quizzes,
  • take one test, and
  • design and implement a final project.

Objectives

Educational Objectives

Among the overarching goals of this course, independent of its curriculum, are to

  • inspire students to explore unfamiliar waters, without fear of failure;
  • create an intensive, shared experience, accessible to all students; and
  • build community among students.

Learning Objectives

Among the overarching goals for students individually in this course is that they learn something that we havenā€™t taught them, as is manifest at termā€™s end by so many studentsā€™ final projects that use languages, libraries, tools, and techniques not taught in the course. Along the way will students learn to

  • think more methodically;
  • program procedurally;
  • represent and process information;
  • communicate succinctly and precisely;
  • solve problems efficiently;
  • recognize patterns among problems;
  • decompose problems into parts and compose solutions thereto;
  • operate at multiple levels of abstraction;
  • separate design from implementation details;
  • infer from first principles how systems work;
  • assess the correctness, design, and style of code;
  • teach themselves new languages;
  • identify threats to privacy and security;
  • read documentation, drawing conclusions from specifications;
  • test solutions to problems, find faults, and identify corner cases;
  • describe symptoms of problems precisely and ask questions clearly; and
  • identify and quantify tradeoffs among resources, particularly time and space.

Ultimately, the course provides students with a foundation for further studies in computer science and empowers students to apply computer science to problems in other domains.

Curricular Objectives

Week 0 # Scratch

  • Problem solving
  • Inputs, Outputs
  • Representation
  • Unary, Binary, Decimal
  • Abstraction
  • ASCII, Unicode
  • RGB
  • Algorithms
  • Running Time
  • Pseudocode
  • Scratch
    • Functions, Arguments, Return Values
    • Variables
    • Boolean Expressions, Conditions
    • Loops
    • Events
    • Threads

Week 1 # C

  • Linux
  • Command-Line Interface
  • C
    • Functions, Arguments, Return Values
    • Variables
    • Boolean Expressions, Conditions
    • Loops
  • Libraries, Header Files
  • Text Editors
  • Terminal Windows
  • Compiler
  • Types
  • Integer Overflow
  • Floating-Point Imprecision

Week 2 # Arrays

  • Preprocessing
  • Compiling
  • Assembling
  • Linking
  • Debugging
  • Arrays
  • Strings
  • Command-Line Arguments
  • Cryptography

Week 3 # Algorithms

  • Searching
    • Linear Search
    • Binary Search
  • Sorting
    • Bubble Sort
    • Selection Sort
    • Insertion Sort
    • Merge Sort
  • Asymptotic Notation
    • O
    • Ī©
    • ʟ
  • Recursion

Week 4 # Memory

  • Pointers
  • Segmentation Faults
  • Dynamic Memory Allocation
  • Stack
  • Heap
  • Buffer Overflow
  • Data Structures
  • File I/O
  • Images

Week 5 # Data Structures

  • Linked Lists
  • Trees, Binary Search Trees
  • Hash Tables
  • Tries
  • Abstract Data Types
  • Stacks, Queues

Week 6 # Python

  • Python
    • Functions, Arguments, Return Values
    • Variables
    • Boolean Expressions, Conditions
    • Loops
  • Modules, Packages

Week 7 # SQL

  • SQL
    • Tables
    • Types
    • Statements
    • Constraints
    • Indexes
    • Keywords, Functions
    • Transactions
  • Race Conditions
  • SQL Injection Attacks

Grades

You must meet all expectations in order to be eligible for a satisfactory grade unless granted an exception in writing by the courseā€™s preceptor.

Final grades are determined using the following weights:

Problem Sets 50%
Quizzes 10%
Test 20%
Final Project 10%
Attendance* 10%

* At classes.

Problem sets and the final project are evaluated along axes of correctness and style, with correctness ordinarily counting for 75% of your score and style counting for 25%. Mid-semester comparisons among students of scores are not reliable indicators of standing.

Know that CS50 draws quite the spectrum of students, including ā€œthose less comfortable,ā€ ā€œthose more comfortable,ā€ and those somewhere in between. However, what ultimately matters in this course is not so much where you end up relative to your classmates but where you end up relative to yourself when you began.

Each studentā€™s final grade is individually determined at termā€™s end. Remarkable effort and upward trending are considered, as is input from the teaching fellows. The course does not have pre-determined cutoffs for final grades. The course is not graded on a curve. Those less comfortable and somewhere in between are not at a disadvantage vis-Ć -vis those more comfortable.

Books

No books are required or recommended for this course. However, you might find the below books of interest. Realize that free, if not superior, resources can be found on the courseā€™s website.

Hackerā€™s Delight, Second Edition
Henry S. Warren Jr.
Pearson Education, 2013
ISBN 0-321-84268-5

How Computers Work, Tenth Edition
Ron White
Que Publishing, 2014
ISBN 0-7897-4984-X

Programming in C, Fourth Edition
Stephen G. Kochan
Pearson Education, 2015
ISBN 0-321-77641-0

Lectures

This spring version of CS50 does not have live lectures. Rather, you are expected to watch each weekā€™s lecture, produced in Fall 2019, on video before each weekā€™s class.

# Lecture Release
0 Computational Thinking, Scratch Mon 1/27
1 C Mon 2/3
2 Arrays Mon 2/10
3 Algorithms Mon 2/17
4 Memory Mon 2/24
5 Data Structures Mon 3/2
6 Python Mon 3/9
7 SQL Mon 3/23
8 Information Mon 4/6
9 Internet Mon 4/6
10 Web Programming Mon 4/13

Classes

Lectures are supplemented by weekly classes led by the courseā€™s preceptor.

Attendance at classes is expected.

Tutorials

For additional help with problem sets, you may optionally sign up for one or more tutorials per week, Wednesdays through Saturdays. An amalgam of tutoring and office hours, tutorials are led by the courseā€™s heads and teaching fellows.

Tutorials will begin in Week 1.

Office Hours

Office hours are opportunities for help with problem sets alongside the courseā€™s teaching fellows and course assistants.

Office hours will begin in Week 1.

Problem Sets

Problem sets are programming assignments that allow you to implement each weekā€™s concepts in code.

# Language Deadline
0 Scratch Sun 2/2, 11:59pm ET
1 C Sun 2/9, 11:59pm ET
2 C Sun 2/16, 11:59pm ET
3 C Sun 2/23, 11:59pm ET
4 C Sun 3/1, 11:59pm ET
5 C Sun 3/8, 11:59pm ET
6 Python Sun 3/22, 11:59pm ET
7 SQL Sun 3/29, 11:59pm ET
8 HTML, CSS, JavaScript Sun 4/12, 11:59pm ET
9 Python, SQL, HTML, CSS, JavaScript Sun 4/19, 11:59pm ET

Quizzes

Quizzes are short assignments due after each lecture that allow you to apply each weekā€™s concepts to new problems. Each quiz is open-book: you may use any and all non-human resources during a quiz, but the only humans to whom you may turn for help or from whom you may receive help are the courseā€™s heads.

# Deadline
1 Tue 2/4, 3pm
2 Tue 2/11, 3pm
3 Tue 2/18, 3pm
4 Tue 2/25, 3pm
5 Tue 3/3, 3pm
6 Tue 3/10, 3pm
7 Tue 3/24, 3pm

Test

The test is opportunity to synthesize concepts across weeks and solve new problems based on lessons learned. The test is open-book: you may use any and all non-human resources during the test, but the only humans to whom you may turn for help or from whom you may receive help are the courseā€™s heads.

Release Deadline
Mon 3/30 Sun 4/5, 11:59pm ET

Final Project

The climax of this course is its final project. The final project is your opportunity to take your newfound savvy with programming out for a spin and develop your very own piece of software. So long as your project draws upon this courseā€™s lessons, the nature of your project is entirely up to you, albeit subject to the staffā€™s approval. You may implement your project in any language(s) as long as the staff approves. You are welcome to utilize any infrastructure, provided the staff ultimately has access to any hardware and software that your project requires. All that we ask is that you build something of interest to you, that you solve an actual problem, that you impact campus, or that you change the world. Strive to create something that outlives this course.

Inasmuch as software development is rarely a one-person effort, you are allowed an opportunity to collaborate with one or two classmates for this final project. Needless to say, it is expected that every student in any such group contribute equally to the design and implementation of that groupā€™s project. Moreover, it is expected that the scope of a two- or three-person groupā€™s project be, respectively, twice or thrice that of a typical one-person project. A one-person project, mind you, should entail more time and effort than is required by each of the courseā€™s problem sets. Although no more than three students may design and implement a given project, you are welcome to solicit advice from others, so long as you respect the courseā€™s policy on academic honesty.

Milestone Date
Pre-Proposal Sun 4/12, 11:59pm ET
Proposal Sun 4/19, 11:59pm ET
Status Report Fri 5/1, 11:59pm ET
Implementation Tue 5/5, 11:59pm ET

Lateness

Late submissions (of quizzes, problem sets, the test, and the final projectā€™s milestones) will be penalized at a rate of 0.1% per minute.

  • If you submit 10 minutes late, your score will be penalized 1%. Your score will thus be 99% of what it would have been if submitted on time.
  • If you submit 60 minutes late, your score will be penalized 6%. Your score will thus be 94% of what it would have been if submitted on time.
  • If you submit 1,000 minutes (just over 16 hours) late, your score will be penalized 100%. Your score will thus be effectively zeroed.

However, you may grant yourself one 3-day (72-hour) extension during the term for any one problem set. That extension cannot be apportioned among multiple problem sets or be applied to quizzes, the test, or the final projectā€™s milestones. To grant yourself this extension, submit this form.

No exceptions to this policy will be considered unless requested of the course by your resident dean (or if you add the course late).

Mental Health

If you experience significant stress or worry, changes in mood, or problems eating or sleeping this semester, whether because of CS50 or other courses or factors, please do not hesitate to reach out immediately, at any hour, to any of the courseā€™s heads to discuss. Everyone can benefit from support during challenging times.

Not only are we happy to listen and make accommodations with deadlines as needed, we can also refer you to additional support structures on campus, including, but not limited to, the below.

Financial Aid

CS50 does not require that students purchase any books, hardware, or software. While not required, having oneā€™s own laptop (and webcam, if not built-in) is helpful, particularly for office hours. Students without their own laptops (or with a laptop without webcam) are encouraged to reach out at termā€™s start to the courseā€™s instructor to discuss possibilities.

Academic Honesty

The courseā€™s philosophy on academic honesty is best stated as ā€œbe reasonable.ā€ The course recognizes that interactions with classmates and others can facilitate mastery of the courseā€™s material. However, there remains a line between enlisting the help of another and submitting the work of another. This policy characterizes both sides of that line.

The essence of all work that you submit to this course must be your own. Collaboration on problem sets is not permitted except to the extent that you may ask classmates and others for help so long as that help does not reduce to another doing your work for you. Generally speaking, when asking for help, you may show your code to others, but you may not view theirs, so long as you and they respect this policyā€™s other constraints. Collaboration on the courseā€™s quizzes and test is not permitted at all. Collaboration on the courseā€™s final project is permitted to the extent prescribed by its specification.

Regret clause. If you commit some act that is not reasonable but bring it to the attention of the courseā€™s heads within 72 hours, the course may impose local sanctions that may include an unsatisfactory or failing grade for work submitted, but the course will not refer the matter for further disciplinary action except in cases of repeated acts.

Below are rules of thumb that (inexhaustively) characterize acts that the course considers reasonable and not reasonable. If in doubt as to whether some act is reasonable, do not commit it until you solicit and receive approval in writing from the courseā€™s heads. Acts considered not reasonable by the course are handled harshly. If the course refers some matter for disciplinary action and the outcome is punitive, the course reserves the right to impose local sanctions on top of that outcome that may include an unsatisfactory or failing grade for work submitted or for the course itself. The course ordinarily recommends exclusion (i.e., required withdrawal) from the course itself.

Reasonable

  • Communicating with classmates about problem setsā€™ problems in English (or some other spoken language), and properly citing those discussions.
  • Discussing the courseā€™s material with others in order to understand it better.
  • Helping a classmate identify a bug in their code at office hours, elsewhere, or even online, as by viewing, compiling, or running their code after you have submitted that portion of the pset yourself. Add a citation to your own code of the help you provided and resubmit.
  • Incorporating a few lines of code that you find online or elsewhere into your own code, provided that those lines are not themselves solutions to assigned problems and that you cite the linesā€™ origins.
  • Reviewing past semestersā€™ tests and quizzes and solutions thereto.
  • Sending or showing code that youā€™ve written to someone, possibly a classmate, so that he or she might help you identify and fix a bug, provided you properly cite the help.
  • Submitting the same or similar work to this course that you have submitted previously to this course, CS50 AP, or CS50x.
  • Turning to the courseā€™s heads for help or receiving help from the courseā€™s heads during the quizzes or test.
  • Turning to the web or elsewhere for instruction beyond the courseā€™s own, for references, and for solutions to technical difficulties, but not for outright solutions to problem setā€™s problems or your own final project.
  • Whiteboarding solutions to problem sets with others using diagrams or pseudocode but not actual code.
  • Working with (and even paying) a tutor to help you with the course, provided the tutor does not do your work for you.

Not Reasonable

  • Accessing a solution to some problem prior to its deadline.
  • Accessing or attempting to access, without permission, an account not your own.
  • Asking a classmate to see their solution to a problem setā€™s problem before its deadline.
  • Discovering but failing to disclose to the courseā€™s heads bugs in the courseā€™s software that affect scores.
  • Decompiling, deobfuscating, or disassembling the staffā€™s solutions to problem sets.
  • Failing to cite (as with comments) the origins of code or techniques that you discover outside of the courseā€™s own lessons and integrate into your own work, even while respecting this policyā€™s other constraints.
  • Giving or showing to a classmate a solution to a problem setā€™s problem when it is he or she, and not you, who is struggling to solve it.
  • Looking at another individualā€™s work during the quizzes or test.
  • Manipulating or attempting to manipulate scores artificially, as by exploiting bugs or formulas in the courseā€™s software.
  • Paying or offering to pay an individual for work that you may submit as (part of) your own.
  • Providing or making available solutions to problem sets to individuals who might take this course in the future.
  • Searching for or soliciting outright solutions to problem sets online or elsewhere.
  • Splitting a problem setā€™s workload with another individual and combining your work.
  • Submitting (after possibly modifying) the work of another individual beyond the few lines allowed herein.
  • Submitting the same or similar work to this course that you have submitted or will submit to another.
  • Submitting work to this course that you intend to use outside of the course (e.g., for a job) without prior approval from the courseā€™s heads.
  • Turning to humans (besides the courseā€™s heads) for help or receiving help from humans (besides the courseā€™s heads) during the quizzes or test.
  • Viewing anotherā€™s solution to a problem setā€™s problem and basing your own solution on it.

Acknowledgement and Authorization

Harvard plans to record audio, photos, and video of Computer Science 50 (CS50) lectures, sections, office hours, seminars, and other events and activities related to CS50 (the ā€œRecordingsā€), with the aims of making the content of the course more widely available and contributing to public understanding of innovative learning (the ā€œProjectsā€). The Recordings, or edited versions of them, may be made available to other Harvard students, to students at other educational institutions, and to the broader public via edX, the Internet, television, theatrical distribution, digital media, or other means. It is also possible that the Recordings may be used to make other derivative works in the future. Students may elect not to appear in photos and video used in the Projects and may still participate fully in CS50.

When you submit Problem Set 0, you will need to sign online an Acknowledgement and Authorization in the following form:

I understand that, if I do not wish any photos or video of me to be used as part of the Projects, I should so inform the courseā€™s instructor by emailing recordings@cs50.harvard.edu within one week of enrolling in CS50. In that event, I understand that I should sit in the designated ā€œno-filmā€ zone of CS50 classrooms and should not walk in the field of view of the cameras. I understand that Harvard will take reasonable steps, with my cooperation, to avoid including identifiable images of me in the Projectsā€™ photos and video shot in classrooms and other course locations after I opt out as just described. I understand that I am free to opt out of the Projectsā€™ photos and video in this way, and that doing so will not affect my grade or my ability to participate in course activities.

Unless I opt out of the Projectsā€™ photos and video as described above and take the steps that will be outlined by the instructor to avoid being filmed, I authorize Harvard and its designees to record and use photos and video of my participation in CS50 and activities related to CS50 (the ā€œRecordingsā€). I understand and agree that the Recordings may include my image, name, and voice. I also understand and agree that, even if I opt out of the Projectsā€™ photos and video, my spoken name and voice may be picked up by microphones outside the ā€œno-filmā€ zone and may be included in the Recordings.

I understand and agree that Harvard and its designees will have the irrevocable, worldwide right to make, edit, modify, copy, publish, transmit, distribute, sell, publicly display, publicly perform, and otherwise use and make available its respective Recordings and any other works that may be derived from those Recordings, in any manner or medium now known or later invented, and to authorize others to do so as well. I hereby transfer to Harvard any rights, including copyrights, I may have in the Recordings that Harvard makes. I will remain free to use and disseminate any ideas, remarks, or other material that I may contribute to course discussions.

I acknowledge and agree that I will not be entitled to any payment, now or in the future, in connection with the Recordings or any works derived from them. This Acknowledgment and Authorization is a binding agreement, and is signed as a document under seal governed by the laws of the Commonwealth of Massachusetts.

Unless you opt out as described in the Acknowledgment and Authorization, you are agreeing, by attending CS50, that your participation in CS50 and related activities may be recorded and used by Harvard in connection with the Projects without further obligation or liability to you, even if you do not sign any authorization.

If you have any questions about the above, contact recordings@cs50.harvard.edu.