Preface
Programming is an increasingly popular skillwhether for those whowant to be professional software developers, or those who want towrite programs to analyze and manipulate data or automate tasks insome other field. Programming course enrollment is soaring, and aplethora of online options are springing up to provide instruction inthe field. However, experience shows that many courses (of eitherform) which aim to teach introductory programming do not actuallyteach how to program.
In writing this book, we set out to provide a platform for instructorsto design courses which properly place their focus on the corefundamentals of programming, or to let a motivated student learn theseskills independently. We do not waste any time or space on thespecifics of the buzzword-of-the-day technology. Instead, we dedicateall of our efforts to core concepts and techniques of programming. Astudent who masters the material in this book will not just be acompetent C programmer, but also a competent programmer,as the title of the book would suggest. 1 1 Our title is also aplayful nod to Larry Wassermans seminal book All of Statistics.
Some people may question the language choice of this book: Why C?Isnt C hard for beginners? Everyone loves language X, why not dothis in X?. At some level, the answer is it does not matter. Weare teaching programming not a particular language. We just needa language so that students can implement.
On another level, C (and C++) are excellent choices for a variety ofreasons. Perhaps most importantly, we can introduce ideas in anatural and logical fashion without just do this because you haveto, but cannot understand it yetsuch a practice is harmful toteaching any programmer, who should fully understand any code shewrites. Furthermore, C and C++ provide a more complete picture ofprogramming concepts. Many other language choices would requireomitting some core concept which that language does not have. Such anomission would require the student to learn an entirely new concept toswitch languages. As the icing on the cake, C and C++ have a longhistory, and still have a wide-spread (and well-paid!) presence inindustry.
We note that this book is quite large: over 30 chapters, and sixappendices, spanning over 700 pages and 7.5 hours of video. Coveringall of this material in a single semester is quite an aggressivepaceapproximately one chapter per class day. Such a pace ispossible, but requires heavily motivated students who are willing toput in significant effort. Generally that pace would only beappropriate to a Masters level ramp up course for studentsswitching disciplines from one with no programming background into onewhere many other classes expect near-professional level programming.
For an undergraduate course, a more appropriate pace would be to usePart I (Introduction to Programming in C) as a CS 1 course (likelywith heavy reference to the appendices on programmers tools andeditors). Such a pace would result in approximately one chapter perweek. A CS 2 course could then be constructed from Parts II (C++)and III (Data Structures and Algorithms) also at approximatelyone chapter per week. Part IVs material could be placed in latercourses that are intended only for more serious programmers.
We further recommend using this book in a flipped classroommodelin which students primary intake of material is done out ofclass (i.e., by reading this book), and in class time is spenton activities. These activities should primarily be formed fromprogramming, or programming-related (e.g., executing code byhand) topics. Students can then perform the most importanttasksdoing programmingwith expert help and guidance available.
We provide some questions and problems at the end of each chapter (inParts I, II, and III) to help you check your understanding of thematerial. Some of these problems ask you to explain the basicconcepts in the chapter. Others ask you to perform the skills youshould be learning (reading and writing code). If you are teaching aclass with this book, we encourage you to create some larger, moresophisticated problems for students to do in classpossiblyproviding some infrastructure to allow students to do write cool andexciting programs. Some practice problems have sample answers inthe back of the book. Such problems have hyperlinks to the answer, and the answer hasa hyperlink back to the problem.
We will also note that this book has embedded videos,which are an integral part of its design. You should watchthe videos as you work your way through this book,as they convey important materiala lot of thingsin programming happen actively, and are much betterconveyed to you, the learner, through animationsrather than static figures. Videos should lookgenerally like this:
You will notice that the video has relatively standardplay controls. You can click the video to play/pause it,as well as use the time-position slider at the bottomto jump backwards or forwards in the video. If you donot understand something, you may want to jump backand rewatch it!
Finally, we will note that this is the second version (edition 1) of thebook. We have worked to remove a variety of typos, and make otherimprovements relative to the first version (edition 0). However,we would be surprised if there are not other typos or issues lurkingsomewhere in the book. If you discover a problem, please checkour website http://aop.cs.cornell.edu/ to see if we are alreadyaware of it. If not, please report the problem to us there. We willpost a correction and fix it in the next edition. If you needto contact us, you can email us at aop@cs.cornell.edu
.