Press Release: November 29, 2005
C++ Cookbook: C++ Recipes Spell Freedom from Mundane Tasks
Sebastopol, CA--C++ has earned a reputation for being one of the more difficult languages to learn. Those who master it, however, are not just gluttons for punishment, but are able to organize and process information with amazing efficiency and quickness. Powerful, highly flexible, and adaptable for use in a wide variety of projects, C++ doggedly maintains its position as one of the most popular programming languages in the world. As is the case with many languages, there exists an abundance of good C++ reference books and tutorials for programmers to draw upon, but far too few resources for the programmer who wants expert advice on how to accomplish common programming tasks in an effective and proven manner. The C++ Cookbook (O'Reilly, US $44.95) by D. Ryan Stephens, Christopher Diggins, Jonathan Turkanis, and Jeff Cogswell, fills this void nicely. The book presents a wealth of solutions to everyday C++ programming problems.
Coauthor Chris Diggins observes that the C++ Cookbook is long overdue, adding, "The C++ book market primarily consists of either 'gotcha' or 'reference' books. As a professional developer, I usually don't want to know ten different ways of doing things, or ten different ways not to do something. I want to know the most effective way to accomplish a specific task as fast as possible. This is something I feel that the C++ Cookbook does well, and is one of the first books to even attempt to address a wide variety of common programming tasks. This is why I was so excited to participate in its development."
Most C++ programmers, whether experienced or newly initiated, are familiar with the sorts of things they have to rewrite on each new project: date and time parsing/arithmetic, string and text, working with files, parsing XML, using the standard containers, and so on. These are the kinds of problems the C++ Cookbook covers. In some cases--such as data and time arithmetic--the standard library contains very little support. In others--e.g. string manipulation--the standard library contains functionally rich classes, but it can't do everything and some very common tasks are cumbersome.
In the C++ Cookbook, the authors provide solutions that reflect current best practices in C++ programming. They focus on performance and portability, with a strong emphasis on formal and ad hoc standards. "One of C++'s strengths is that there are many ways to do the same thing, but this can muddy the waters for novices," notes coauthor Stephens. "We wrote this book to provide ready-made solutions to common problems using the best practices so readers can look up a problem, read the solution, tailor it to his or her needs, and take away some useful wisdom." Many of the solutions take advantage of the C++ standard library. The authors also cover the Boost libraries, which represent some of the best thinking in the world of C++.
In creating their code examples, the authors strove for simplicity, portability, and performance. Topics covered in the book include: working with numbers, dates and times, stream-based input/output, exception handling, building applications with make, multithreading, standard library algorithms and containers, internationalization, and the Boost build system.
The C++ Cookbook is written in a straightforward format, featuring recipes that apply not to hypothetical situations, but to those that programmers are likely to encounter. A detailed explanation then follows each recipe in order to show readers how and why the solution works. This question-solution-discussion format is a proven teaching method, freeing programmers from mundane, time-consuming problems so they can turn their talents to more interesting work.
- Chapter 10, "Streams and Files"
- More information about the book, including table of contents, index, author bios, and samples
- A cover graphic in JPEG format
For almost 40 years, O’Reilly Media has provided technology and business training, knowledge, and insight to help companies succeed. Our unique network of experts and innovators share their knowledge and expertise through the company’s Safari training and learning platform and at O’Reilly conferences. As a SaaS learning platform, Safari delivers highly topical and comprehensive technology and business learning solutions to millions of users across enterprise, consumer, and university channels. For more information visit oreilly.com.
Return to: O'Reilly Press Room