Preface to "effective STL Chinese Version"

Source: Internet
Author: User
Tags documentation

"Effective STL Chinese Version" Preface
The first time I wrote about STL (standard templatelibrary, Standards Template Library) was introduced in 1995, when I made a cursory introduction to STL in the last article in more effective C + +. Shortly thereafter, I received some emails asking when I was going to start writing effective STL.

I have been rejecting this idea for several years. At first, I was not very familiar with STL, it was not enough to provide any advice on STL. But as time went on, and my experience grew, my ideas began to change. There is no doubt that the STL library represents a breakthrough in program efficiency and extensibility design, but when I started to really use STL, I found many practical problems that I could not have noticed. In addition to the simplest STL programs, porting a slightly more complex STL program is problematic, not least because the STL library implementation has its own special aspects, but also because the underlying compiler supports the template differently-some support is very good, but some are very poor. It's not easy to get the correct guide to STL, so it's very difficult to learn how to program STL, even after overcoming the hurdles in this phase, it's still a challenge to find a reference document that's easy to understand and describe accurately. Perhaps most frustrating is that even a small STL usage error often results in a whole bunch of compiler diagnostic information, and each diagnostic message can be thousands of characters in length, and most will refer to classes, functions, or templates that are not mentioned at all in the source code (which is almost impossible to understand). Although I appreciate STL and admire the people behind STL, it is very uncomfortable to recommend STL to programmers who are actually working on the development. Because, I'm not sure if it's possible to use the STL effectively.

Then I began to notice something that surprised me a lot. Although the STL has a portability problem, although its documentation is incomplete, although the compiler's diagnostic information is like noise on the transmission line, many of my consulting customers are using STL. Moreover, they do not just take the STL to play, but instead use it to develop the actual product. This is a very important revelation. In the past I knew that STL was a very well-designed template library, and I gradually felt that since programmers are willing to endure transplant trouble, incomplete documentation, and difficult-to-understand error messages, there must be other advantages to this library in addition to good design. As the number of professional programmers grows, I realize that even a poor STL implementation is better than no implementation.

Further, I know the situation of STL is getting better. C + + libraries and compilers are increasingly complying with the C + + standard, and good documents are beginning to emerge, and the compiler's diagnostic information is improving. So I decided to devote myself to this STL campaign and try my best to make a modest contribution. This book is the result of my efforts: 50 effective use of STL experience.

My original plan was to write this book in the second half of 1999, and I thought about it all the time, and there was an outline. But then I changed the course. I set aside the writing of the book, and developed a guided training course on STL, and also taught several groups of programmers. About a year later, I returned to the writing of this book and revised the outline of the book based on the experience gained in the training course. Just as effective C + + successfully builds on the problems faced by real programmers, I hope that this book will also face a variety of practical problems in STL programming in a similar way, especially those that are particularly important to professional developers.

This article is excerpted from "effective STL Chinese Version" a book

Pan Chen Ming Caigong

Publishing Industry Publishing house

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.