It is my hope that this book will help instructors to communicate practical programming skills as well as help students to develop better software."> It is my hope that this book will help instructors to communicate practical programming skills as well as help students to develop better software."> It is my hope that this book will help instructors to communicate practical programming skills as well as help students to develop better software.">
Today, software bugs are clearly a constant source of frustration with computers and also pose considerable security and safety concerns. While methods exist to prove the correctness of programs, they are not fully automatic and all requires significant training. Consequently, there is no real alternative to careful and systematic testing of programs to ensure that the software fulfills its designated function (even though testing cannot guarantee the absence of bugs). A further indication of the importance of this topic is that all accepted software development practices, such as Extreme Programming, require that programmers test their systems. While testing is taught abstractly in many courses, few students realized how important thorough testing is in practice. Only in the field do they gain this experience and learn the related skills. Hand in hand with testing goes debugging, the art of finding a problem based on observable symptoms and then fixing the problem. Last, but not least, optimization of programs is a skill that is often necessary for competitive systems.
When faced with the task of helping to re-design a second-year course on practical programming, I decided that C and UNIX were the right platform to teach many of the skills necessary for practical program development. Today, many students learn Java (or similar languages) in their first year, as this provides a relatively good and safe environment for learning the fundamental concepts. However, computer science students need to know how the layers underneath a high-level programming language work. C, besides being a high-performance environment and a prerequisite to C++, exposes students to these underlying layers and hence allows them to get a better understanding of how software works. Furthermore, a lot of safety layers (e.g., automatic handling of arithmetic overflows) are not present here, which makes this an ideal vehicle to teach the importance of testing. UNIX, with its cleverly designed file system, interactive shell and scripting languages, provides an excellent environment for systematic and repeated testing. The current implementation of the course teaches the importance of testing via strict enforcement of adherence to specifications in assignments. This is done with automatic, and hence objective, testing of assignments. As the test cases are revealed only after the deadline, this forces students to think very carefully about the robustness of their programs.
This textbook is designed to be used together with "The C Programming Language" by Kernighan & Ritchie. One of the most frustrating aspects of designing a course on practical programing is that there are very few textbooks that cover important skills, such as testing, debugging, optimization, the use of scripting languages, etc. with adequate examples. Fortunately, I found that parts of a book on the UNIX environment ("The UNIX Programming Environment by Kernighan & Pike) and parts of a book on the practice of programming ("The Practice of Programming" by Kernighan & Pike) provide a good combination. Together, the new book covers most important issues for practical program development and hence forms a good basis for a course that focuses on such issues.
It is my hope that this book will help instructors to communicate practical programming skills as well as help students to develop better software.