Textbooks and Resources
There is no required textbook for this course. However, we do highly recommend C: A Reference Manual by Harbison and Steele. I have found it to be invaluable and always near my desk. I asked Baker Library to obtain a copy and place it on reserve, however you can also find a copy of the pdf online. There may be copies available in local bookstores, or you can order it from Amazon or Barnes & Noble. Look for the most recent (fifth) edition.
When we need a more traditional C text, we refer to The C Book, second edition, by Mike Banahan, Declan Brady and Mark Doran, originally published by Addison Wesley in 1991. This book is available online here.
The UNIX operating system and the C programming language have both been around for quite some time. UNIX was originally developed in the late 1960’s in assembly language and was mostly reimplemented in the new C programming language by the early 1970’s. The first book on C, Kernighan and Ritchie’s C Programming Language, is still in print, and is owned by most UNIX geeks – not because it’s such a great reference, but, well, just because. There are a large number of number of books on UNIX and all of its variants, including Linux (see below).
UNIX systems contain lots of documentation in the form of what are called
man pages, which is short for “manual pages”. Thus, a hardcopy book on UNIX may not be really necessary – I didn’t own a UNIX book until many years after I began using UNIX.
Documentation for many of the tools we will be using will either be found in
man pages or will be supplied as URL’s on this page. Of course, you’re welcome to employ your favorite search engine, but beware that there are subtle variations in UNIX tools across its many flavors and distributions. For CS50, the
man pages on CS department servers are the definitive reference.
Other resources, papers, and references will appear on in this page as they are identified. If you find others that you like, please let me know and we’ll share them with everyone.
- CS50 Coding Style.
- CS Department User’s FAQ; you’ll need to log in using your CS UNIX username and password.
Here are some good links to bash scripting information.
- Short bash tutorial
- GNU bash manual
- BASH Programming - Introduction HOW-TO
- Advanced bash scripting guide
- Bash Pocket Reference: Help for Power Users and Sys Admins, 2nd Edition, by Arnold Robbins; a short and useful book for less than ten bucks.
Editor software is a very personal choice. I have primarily been using
sublime text editor for longer sessions and
vi for quick fixes, while others prefer
emacs. They are all excellent tools. For quick fixes and slow ssh connections the
vi editor is a workable alternative.
- Getting started with Sublime Text and a great tutorial
- An Extremely Quick and Simple Introduction to the Vi Text Editor
- vim tutorial
- Emacs tutorial
A file with extension
.md is assumed to be a text file in ‘Markdown’ syntax, which provides very simple (and readable) markup for headings, lists, italics, bold, hyperlinks, code snippets, and embedded images. (This course website is written in Markdown and render with Jekyll.) Many source-code web portals (like our Gitlab and the popular Github) allow you to browse the files in your repository - automatically rendering any that are in Markdown format, making such files much nicer to look at than plain-text files. You can edit Markdown files in any text editor, but there are some specialized editors available. Markdown is easy to learn and there are many useful resources online:
- a quick tutorial.
- Github’s Mastering Markdown tutorial.
- Github’s Markdown cheatsheet.
- Brett Terpstra’s Write better Markdown, which recognizes that many flavors of Markdown exist.
- Markoff, a MacOS application for previewing Markdown files.
- Macdown, a MacOS application for editing Markdown files.
Great references for the
git distributed version control system that we use
- Free “Pro Git” book by Scott Chacon, plus the website has LOTS of additional git references, including videos!
- A limited interactive tutorial - try.github - Some other non-interactive video tutorials
- A very slick (and free) GUI for
gitcalled SourceTree is very popular, as is the excellent licensed (not free) application Tower2.
- Reference for common
- Information and instructions about SSH vs HTTPS; although it is from Github the steps for setting up SSH are similar on Gitlab.
Software tools we may be using
- valgrind: a family of tools for dynamic analysis of programs.
GNU make is a utility for determining what needs to be done (e.g., compile, link, copy, etc.) to build a program or other target, and then issues the commands to do it.
pandoc: A universal document converter.
gtk: A popular toolkit for creating graphical user interfaces. Follow the X11 instructions below to learn how to compile and use
- X11 and XQuartz: to run window-based (or graphical) applications on the CS50 Unix servers, but allow them to pop open windows on your Mac, you’ll need to install XQuartz. Installation is simple; this link has instructions for installing and using XQuartz, and for compiling
Unix & Linux books / links
- A Practical Guide to Linux Commands, Editors, and Shell Programming, by Mark G. Sobell; an excellent, comprehensive, hands-on book on Linux and shell programming as well as Python, Perl, and MySQL.
- Beginning Linux Programming, 4th Edition, by Neil Matthew, Richard Stones; A really good book covering, debugging, processes, threads, and socket programming in clear and easy manner
- The Practice of Programming, by Brian W. Kernighan, Rob Pike; a great classic book on design and programming for Unix and C.
- Professional Linux Programming, by Jon Masters and Richard Blum; an oldie (2007) but a goodie.
- UNIX Network Programming, by W. Richard Stevens, 2003; Prentice-Hall.
- Linux in a Nutshell
- Linux System Programming
- What Is the X Window System, from O’Reilly’s linux devcenter.com
- Unix, Linux, and variants, free website listing common Unix commands
- Bash command line editing
- Unix for MacOS X users, a video tutorial from 2011 version of MacOS X. From Lynda.com, which is free to Dartmouth users.
- Homebrew, a tool for installing Unix tools on MacOS. Highly recommended for CS50!
C programming tutorials – video tutorials from Lynda.com, which are free to Dartmouth users.
- The Pragmatic Programmer, by Andrew Hunt and David Thomas. 2000, Addison Wesley.
- 97 things every programmer should know, by Kevlin Henney. O’Reilly 2010.
- A First Book of ANSI C, Fourth Edition, by Gary J. Bronson; a very good book for learning C
- Linux Kernal Coding style, by Linus Torvalds
- The Wikipedia entry for the C programming language
- The USENET discussion Why is C good?
- An Introduction to the C programming language, by Charles Palmer (1988). Easy read with lots of simple examples. Skip to page 20 to start, and remember some of the comments are dated (e.g., “variables in all lower case”).
- Quick reference cards for C and gdb .
Remember that we’re not suggesting you buy all these books. The text by Harbison and Steele is highly recommended for this course and may be in local bookstores.