Comp 15

Reference Material

Table of Contents


C++ References

Programming in C++ is not easy! There are many intricacies and details of the language that, simply put, take time and effort to understand. But fear not! We are here to help you succeed. Please see the following review material for specific notes on common sticky points. As always, ask questions on piazza and in office hours!

Comp 11 Review

Coming into Comp 15, we expect some familiarity with the below topics, and so might not cover them in full detail. you will need this information to succeed in this course. The below are notes on various topics from a previous version of Comp 11, or otherwise resources created by TA's to address common confusion. If you are new to Tufts or C++, or if you're just a little rusty, please review these topics.

Comp 15 Course Resources

There are a number of reference resources that provide supplemental or required reading for topics throughout the course.

Course Materials

Style Guide

The style guide contains style and documentation expectations for this course. Every piece of code you submit for an assignment will be graded on readability, structure, and organization, as well as functionality. Therefore it is very important you are familiar with the expectations in the style guide. We recommend that you return to the style guide throughout the semester to ensure your code complies with our style requirements.

Tips for Success

The tips for success document is a compiled list of things that will help you do well in this course.

Office Hours Guide

The guide to office hours is a an overview of our procedures for debugging and office hour policies. Reading this will allow you to make good use of our office hours and will outline the general expectations we have when helping students. By following these policies, we can help people better and faster, and these will make everyone's life easier

FAQ page

The FAQ page will give an overview of some questions we see come up during the semester. It is a good place to check if you have a question someone might have asked before!

Debugging

All non-trivial programs have bugs (and most trivial ones do, too). C compile-time errors are often not helpful, and run-time errors are mostly just “segmentation fault” or “bus error.”

Well-written, well-organized code is easier to debug. When debugging, one should think. Many students will reflexively respond to the compiler message “attempt to make int from pointer without a cast” by inserting a cast. Usually, that's not going to fix the problem.

Search engines like Google have really changed debugging: it is very common now to copy and paste an error message one doesn't understand into a search engine and look it up that way. But that is not enough.

You will benefit by becoming familiar with a proper debugger. Runtime error messages are generally uninformative, and sometimes, a flood of print statements won't do the trick. May full-fledged IDEs have integrated debuggers that let you run your program one statement at a time or stop at a particular line in a particular function.

gdb is the GNU debugger and has a line-oriented interface. It is available on our department computers, and, while it takes time to learn, it can be extremely powerful. I use it frequently. (It has a GUI front end called ddd, which, alas, is somewhat abandoned sofware: It has not been maintained and has become brittle. Nonetheless, it is available on our system. Documentation is available via the web and in a downloadable PDF document. You can explore it, but perhaps don't rely on it too much.)

Think of a debugger as a replacement for the interactive read-eval-print loop in interpreted environments that you may have used in languages like Python, ML, or Scheme.

We have this resource on debugging memory errors and segmentation faults, which are common bugs you will have to deal with in this class.

Mark A. Sheldon (msheldon@cs.tufts.edu)
Last Modified Jan 20212021-Feb-26