STL's father's interview

zhaozj2021-02-12  178

In March 1995, Dr.Dobb's Journal, the famous technical book writer Al Stevens interviewed the STL founder Alexander Stepanov. This interview record is the most complete introduction to the history of STL, Mr. Houjie is related to his STL. I recommend you to read this article in the article.

Q: You have a long study for Generic Programming, please talk about it. A: I started to consider the problem about GP is at the end of the 7o year, I noticed that some algorithms did not depend on the specific implementation of the data structure, and Just relying on several basic semantic properties of this structure. So I started researching a large number of different algorithms, and the results have found that most algorithms can be abstract from a particular implementation, and the efficiency is not damaged. For me, efficiency is Vocation, if an algorithm is abstract in instantiation, it will lead to a decline in performance. At that time, I thought that the correct direction of this study was to create a programming language. I started with my two friends. And now the current New York State University Professor Deepak Kapur, the other is the professor of the Lenrier Institute of Technology. At that time, we worked at the General Electric Appliance Research Center. We started designing a language called Tecton. There is a thing we call "universal structure", in fact, it is just a collection of forms and attributes, and people can use it to describe algorithms. For example, some mathematical structures allow people to define an algebraic operation, fine Chemically, expand, do a variety of things. Although there are many interesting ideas, the final study did not achieve any practical results, because the Tecton language is a function type language. We believe in the concept of Backus, I believe you can program From the Von Neumann style, we don't want to use the sub-effect, which limits our ability because there is a large number of algorithms such as "status", "sub-effect".

I realized an interesting question in TECTON in the late 1970s: The concept of ADT has a fundamental defect. People usually believe that ADT is characterized by exposing object behavior, but will hide. One action The complexity is considered to be related to the relevant attributes, so it should be ignored when abstract. I realize that the complexity (or at least general concept of complexity) must be simultaneously in consideration of a (abstract) operation. Take into account. This is now one of the core ideas of GP.

For example, an abstract stack stack type, only ensures that your push go in, it is not enough to be POP, the same extreme is important, no matter how large stack is, your PUSH operation must be completed within the constant time. If I write A Stack, every Push is slow, then no one will use this rotten play.

We have to separate the implementation and interface, but you can't completely ignore complexity. The complexity must be, and it is indeed the inconsistent contract between the user and the implementation of the module. The introduction of the ADT concept is to allow software The modules can be replaced with each other. But unless otherwise complexity is similar to this module, you will definitely don't want to achieve this interchange. If I replace the original module with another module and provide exact same interface and behavior, But the complexity is different, then the user is definitely not happy. Even if I spend the advantages of abstract achievement, he is definitely not willing. Complexity must be considered part of the interface.

Around 1983, I transferred to New York Brooklyn Technology. Beginning is the algorithm of the map, the main partners are now IBM Aaron Kershenbaum. He is an expert in the map and network algorithms, I believe he believes in the high order ( High Order's idea and GP can be applied to the algorithm of the figure. He supports me to work with him to start using these ideas for the actual network algorithm. The algorithm of some pictures is too complicated, only the theoretical analysis, never realized His attempts to establish a toolbox containing high-order general components, so some algorithms can be achieved. I decided to use a variant of the Lisp language to build such a toolbox. We have established a huge The library shows various programming techniques. The network algorithm is the primary goal. Soon, the David Musser in General Electric is also added, and more components have been developed, a very large library. This library is used under the college undergraduate Never commercialization. In this work, I learned that the deputy efficiency should be very important. I don't have the use of the secondary effect. You can't figure out the picture. You can't change a endpoint (Vertex). On the circle. So, the experience you get at the time is to combine the high order technology and deputy efficiency when implementing a general algorithm. The sub-effect is not always bad, only when it is used in the wrong use. In the summer, I returned Universal Electric teaches the course of high-ascending programming. I showed the application of this technology when component complex algorithm. There is a class of people named Chen. At that time, he was the director of the Information System Laboratory. He asked if I can use ADA Language implements these technologies, forming a library of industrial strength, and represents support. I am a poor teaching, so I don't know what I don't know about ADA, I still answer this ADA with Dave Musser. Library. This is a very important period, from the dynamic type language like Scheme to the strong type language such as ADA, so I realize the importance of strong types. No one knows that the strong type helps to correct Wrong. I found that in ADA's general programming, strong types are a powerful tool for design ideas. It is not only the error tool, but also ideological tools. This work gives me the concept of orthogonal decomposition for component space. I realize that the software components have their own different categories. OOP's fanatic supporters think everything is object. But I realized that I am in the work of the ADA General Library, this is not right. I'm not an object, it is an algorithm In addition, I also realized that by breaking down the component space into several different directions, we can reduce the number of components, more importantly, We can provide a conceptual frame of design products.

Subsequently, I got a job in the Bel laboratory C group. They asked if I could do something similar to C . I still don't understand C , but of course, I said to me. Result I can't, because in 1987, there is no template in C . This play is a necessity in common programming. The result has to use inheritance to obtain versatility, obviously not ideal.

Until now the C inheritance mechanism is not used in universal programming, let's say why. Many people want to use inheritance to achieve data structures and containers, and the result is almost all unattime. C inheritance mechanism and related programming style have dramatic Limitations. With this way, universal programming, even if you are trying to determine the small problems of this class, if you use the X class as the base class, you have designed a virtual function operat ==, accept a X-class object, and Derive class Y, then y's operator == is compared to the Y class object with the X class. Take an animal as an example, define an Animal class, derived a Giraffe class. Define a member function Mate (), implementation A mating operation of a mammal, returns an Animal object. Now look at your derived Giraffe, and it is of course a MATE () method, and the result is a giraffe mating, returns an animal object. What is the body? Of course, For C programmers, the mating function is not that important, but Operator == is very important.

To deal with this problem, you have to use templates. With template mechanisms, everything is willing.

Although there is no template, I still got a huge algorithm library, and later became part of UNIX System Laboratory Standard Component Library. In Bell Lab, I am from Andy Koenig, Bjarne Stroustrustrup (Andrew Koenig, President of the Former ISO C Standardization Committee; Bjarne) Stroustrup, C Parent - Translator) This kind of expert learns a lot. I realize that C / C is important, and some of their success cannot be ignored. Especially I found that the pointer is a good stuff. I am not an air-hung pointer or pointing to the stack. I said that the general concept of the pointer. The idea of ​​the address is widely used. No pointer us can't describe the parallel algorithm. We now discuss why c is A great language. Usually people think that C is a programming tool and has been successful because UNIX is written with C. I don't agree. Computer architecture is the result of long-term development, not which smart person creates In fact, the majority of programmers have promoted these systems to propose these systems in the process of solving practical problems. The computer has passed multiple evolution, and now only needs to process the memory, linear address space and pointer of the byte address index. This Evolution is the natural reflection of people to solve problems. Dennis Ritchie genius works C, which reflects the smallest model of the 30-year computer. C is not cut at the time. But when the computer is used to handle various problems As the minimum model, C has become a very powerful language, which is very efficient when solving various problems in various fields. This is the mystery of C. C is the best abstract model of all computers, and this abstraction It is true to be built on the actual computer, rather than imaginary computers. People can understand the machine model behind C, which is much easier than the machine model behind the ADA and Scheme. C is because C Do the right thing, not because AT & T's greatness is advocated and UNIX.

The success of C is because Bjarne Stroustrup improves C with C, introducing more programming technology, but always remains within the machine model framework defined by C, rather than closed the door to make a new machine model. The machine model of C is very simple. You have memory, the object is saved there, you have a pointer to continuous memory space, very well understood. C retain this model, but it has expanded the category of objects in memory, after all C. The data type is too limited, it allows you to create a new type of structure, but you do not allow you to define a type method. This limits the ability of the type system. C extends C's machine model to a real type system.

In 1988, I went to HP Laboratory to work in Universal Bank Development. But I actually made a disk drive for a few years. I am very interesting but it is not related to GP. In 1992 I finally returned to the GP field, the Lab Director Bill Worley established A algorithm research project, is responsible. At that time, C already had a template. I found that Bjarne's template design was very talented. When Bell Lab, I participated in several early discussions about the design of the die design, follow Bjarne is very fierce, I think C template design should be seen to the General Solution of Ada as much as possible. I think I am quarrel, and the Bjarne decided to resolutely refuse my suggestion. I realized it in C . The template function is the need, and many people feel that it is best to only template. But I think a template function must be explicitly instantiated before use, and it is like ADA. Bjarne does not listen to me, he puts template The function is designed to be implicitly instantiated with an overload mechanism. Later, this special technology became critical in my work. I found that it allows me to do a lot of mission in ADA. I am very happy that Bjarne didn't listen to me.

Q: What is the first concept of thinking STL, what is the initial purpose? A: 92 years of projects were established by 8 people, gradually, more and less, the last two, I and Li Men, and Miss Li is a newbie in this field. In her professional research, the compiler is the main job, but she accepts the idea of ​​GP research, and firmly believes that this study will bring a large change to the software, know that this is believed. There is very little recognition. No her, I can't imagine I can get STL. After all, the STL is labeled two people: Stepanov and Lee. We wrote a huge library, huge code, large data structural components, Function object, adapter class, etc. But though there are many code, but there is no document. Our work is considered a verification project, and its purpose is to figure out that it can still be in the premise that the algorithm is usually utility. Very high efficiency. We have been compared for a lot of time, and the results have found that our algorithm is not only most common, but the rate is as efficient as handwritten code, this program design style is not discounting in performance! This library grows, But it is difficult to say when it becomes a "project". The birth of STL is a good thing for a few things. Q: When is it, what is the reason for your decision to make STL a ANSI / ISO standard C part? A: In 1993, Andy Koenig ran to Stanford to talk about C lesson, I looked at him about some related materials, I think he is really very excited. He arranged me to go to San Jose to make a speech. The topic of my speech is the "science of C programming", which is very theoretical. It is important to follow the principles of basic operations. I have given some examples, such as constructor, assignment operations. , Equal operation. As a language, C has no restrictions. You can use Operator == () to make multiplication. However, equal operation should be equal. It should have anti-transfection, A == a; it must Symmetry, a == b, b == a; it also has passed. As a mathematical aircraft, equal operation is a basic element for other operations. Connection between constructor and equal operations, there is a routine Inside. You have generated a new object with the copy constructor, then this object and the original one should be equal. C is not forced to do, but this is what we must comply with this rule. Similarly, assignment operations must also Produce equal objects. I showed some basic operations "axiom", and ITOR, and how some general algorithms used iterations to work. I think that It is a two-hour boring speech, but it is very popular. But I didn't want to put this East and West in the standard. After all, it was too advanced programming technology, which is probably not suitable for appearing in the real world, I am afraid. Those who do actually work is not interested in it.

I did this speech in September, until the following year (1994) month, I didn't move to ANSI standard. On January 6th, I received a letter from Andy Koenig (he was standard at that time. Document project editing), the letter says if I want STL to become part of the standard library, can submit a proposal to the Committee before January 25. My answer is: "Andy, are you crazy?", He replied "Yes, I am crazy, why don't we try it?"

At that time, we had a lot of code, but there was no document, there was no formal proposal. Miss Li and I work 80 hours a week, I finally wrote a formal proposal before the deadline. When it is also, only Andy knows What might happen. His only supporter, he did provide a lot of help in that day. We sent the suggestion. Then we have done a lot during the process of writing the suggestion. When you Write a thing, especially if you think that you may be a standard, you will find all the leaks in the design. After sending the standard, we have to rewrite the code in the middle of the library, and hundreds of components. Before you have been the San Diego meeting in March. Then we re-revised the proposal, because in the process of rewrite the code, we found a lot of 疵 in the middle of the proposal.

Q: Can you describe the debate in the committee? It is recommended to be supported by the beginning, or oppose? A: I can't expect anything. I have a report, my reaction is very good. But there are many oppositions. Comments. The main opinion is: This is a huge suggestion, and it has been too late. At the previous meeting, the resolution has been made, not accepting any big suggestions. This thing is the biggest suggestion ever, including a big Stack of new games. The results of voting are interesting, and most of the observations believe that the recommendations will be considered, and the voter is postponed until the next meeting. It is the next Waterloo meeting. Bjarne Stroustrup became STL's strong supporters. Many People have given help through suggestions, changes, and revisions. Bjarne simply ran to this to work with us a week. Andy is even more helping us. C is a complex language that does not always know exact meaning. Almost every day I have to ask Andy and Bjarne C to do this. I have to pay special honors to Andy, which is part of the STL as part of the C standard library; and Bjarne has become the main advocator of STL in the committee. Other people who want to thank: Mike Vilot, the person in charge of the standard library group; Rogue Wave's Nathan Myers (Rogue Wave is the provider of the STL scheme in Boland C Builder, the Larry of Andersen Consulting Podmolik. There are still many people to thank.

The STL proposed in San Diego is actually C at the time, we are required to rewrote STL with new ANSI / ISO C language characteristics, and some are not implemented. In order to correctly use these new, unreal C features, Bjarne and Andy spend the time that is not countless to help us.

It is desirable that the container is independent of memory mode, which is too much because the language itself does not include memory mode. So we have to think about some mechanisms to abstract memory mode. In the early versions of STL, it is assumed that the volume of the container can be represented by the SIZE_T type, and the distance between the iterative sons can be represented by PTRDIFF_T. Now we are told, why do you not abstract these types? This requirement is relatively high, and the language itself does not have an abstraction to define these types, and the C / C array cannot be defined by these types. We invented a mechanism called "allocator" to encapsulate information about memory mode. This mechanism profoundly affects each component between the library. You may be confused: What is the relationship between memory mode and algorithm or container class interface? If you use Size_t, you can't use the T * object because there are different pointer types (t *, t huge *, etc.). This way you can't use the reference, because the memory mode is different, there will be different reference types. This will lead to a huge branch of the standard library.

Another important thing is that our original associated type data structure is expanded. This is relatively easy, but the most standards are always difficult because we do what we do will use many years. From the point of view of the container, STL has made a very clear two-point design. All containers are divided into two types: sequential and associated, like conventional memory and memory in content. The semantics of these containers are very clear.

When I went to Waterlu, Bjarne used a lot of time to comfort me, don't be too embarrassed, because I didn't seem to succeed, but we did it after all. We tried it, so we should face it calmly. The expectation of success is very low. We estimate that most of the opinions will be opposed. But in fact, there is indeed some objection, but do not take up the wind. The results of Waterloo voting make people fall in glasses, 80% are spoiled, 20% opposition. Everyone expects to have a fierce battle, a big argument. The result is an argument, but voting is overwhelming. Q: What is the impact on the class libraries in the ANSI / ISO C work file issued in February 1994? A: STL is placed in the work file of the Waterloo meeting. The STL document is broken down into several parts, placed in different parts of the file. Mike vilot is responsible for this matter. I have not participated in the editorial work, or even members of the C committee. But every time I have considered it. The committee is considered or is still very thoughtful.

Q: The Committee later made some changes related to the template mechanism, which affects STL? A: There are two changes to the STL before STL is accepted. One is that the template class adds the ability to include a template function. STL has widely used this feature to allow you to build a container of various receiving containers. A separate constructor allows you to build a vector to accommodate List or other containers. There is also a template constructor that constructs a container object from an iterative subsequent, you can use a pair of iteration as a parameter to pass it, which is used to construct a new container object. Another new feature used by the STL is to pass the template itself as a template parameter to the template class. This technology is used in the Allocator just mentioned.

Q: STL affects the template mechanism? A: In the Meetings of the Fosgia Valley, Bjarne recommends adding a "partial specialization" feature to the template. This feature allows many algorithms and class efficiency, but also brings problems in code volume. I studied for a while with Bjarne in this suggestion. This proposal is to make STL more efficiently. Let's explain what is "local specialization". You now have a template function SWAP (T &, T &, Used to exchange two parameters. But when t is some special type parameters, you want to do some special things. For example, for SWAP (INT &, INT &), you want to use a special action to exchange data. This is impossible in situations where there is no local specialization mechanism. With local specialization mechanism, you can declare a template function as follows: Template

Void Swap (Vector

&, vector

&);

This form provides a special way to the SWAP operation of the VECTOR container. This is very important from the perspective of performance. If you use a universal form to switch your vector, three assignments are used, and the Vector is copied three times, and the time complexity is linear. However, if we have a local specialized SWAP version to exchange two vectors, you can get a time complexity constant, very fast, as long as the two pointers in the vector header are OK. This can make the Sort algorithm on the Vector run faster. There is no local specialization, let a special vector, such as Vector

The only way to run is to let the programmer set a special SWAP function, which has a trip, but has increased the burden of programmers. In most cases, local specialization mechanisms can make algorithms more efficient in some general classes. You have the most universal swap, less universal SWAP, more uncommon swap, completely special SWAP such overloaded SWAP, then you use local specialization, the compiler will automatically find the closest SWAP. Another example is COPY. Now our Copy is copied one by one by iteration. Use template specialization to define a template function: Template

T ** COPY (t **, t **, t **);

This can be implemented using Memcpy to be efficiently copied, because it is a pointer copy, we can do not worry about constructive objects and destructure objects. This template function can be defined once and then used throughout the library, and the user does not have to worry. We use local specialization to handle some algorithms. This is an important improvement, according to my knowledge, I have received praise in the Foshan Valley meeting, and will become part of the standard in the future. (Later indeed became a standard part - translator)

Q: In addition to the standard library, STL is the most useful place for the application of that class? A: I hope that STL can guide you to learn a new programming style: universal programming. I believe this style is suitable for any type of application. This style is: write algorithms and data structures in the most common way. The semantic characteristics required by these structures should be clearly classified and classified, and the principles of these categorized classifications should be satisfied. Understanding and developing this technology is still a long time, STL is just the starting point of this process. We will ultimately have a standard classification for general components that have carefully defined interfaces and complexity. Programmers will not be able to program at the microscopic level. You don't have to write a two-point lookup algorithm. That is, STL has also provided several general two-point lookup algorithm, and these algorithms can be used in the case of two-point lookup algorithm. The prerequisites required by the algorithm are very small: you just use it in your code. I hope that all components can have such a day. We will have a standard classification, people don't have to repeat these work.

This is the dream of Douglas MCILROY, and he is in the famous article in the "component factory" in 1969. STL is an example of this "component factory". Of course, there is still a need for mainstream power to intervene in this technology, and the research institution is not in the research institution. The industry should want to provide components and tools to help them find the components needed, bond the components together, then Determine whether complexity reaches expectations.

Q: STL does not implement a persistent object container model. Map and Multimap seem to be a better candidate, which can store objects into a persistent object database with an index. What do you do in this direction, or what comments do you have for this type? A: Many people pay attention to this problem. STL did not achieve persistence. STL is already the most acceptable library that can be accepted at the time. If you are bigger, I think the Committee will definitely not accept it. Of course, persistence is indeed a problem proposed. When designing STL, especially when designing allocator, Bjarne believes that the component encapsulated memory mode can be used to encapsulate persistent memory mode. Bjarne's insight is very important and interesting, several object database companies are staring at this technology. In October 1994 I participated in a meeting of Object Database Management Group, I did a speech. They are very interested in letting them are in the interface of the components in the group, but do not include allocator. However, certain members of the group carefully analyzed whether allocator can be used to achieve persistence. I hope that the component object persistence of the STL interface can appear in the next year. Q: Set, MultiSet, Map and Multimap are implemented with red black trees. Do you tries to use other structures, such as the B * tree to achieve? A: I don't think B * is applicable to the data structure in memory, but of course this matter should still be done. The standard interface of STL containers should be implemented in many other data structures, such as Skip List, SPLY TREE, Half-Balanced Tree, and the like. Such research should be made because STL provides a good framework that can be used to compare the performance of these structures. The opening is fixed, the basic complexity is fixed, and now we can make a significant comparison of various data structures. There are many people in the field of data structures to achieve different data structures, I hope they can use the STL framework to turn these data structures into common. (Translator Note: I think most of the data structures mentioned above is not urgent, and a STL does not provide but a truly important data structure is a hash structure. Later SGI * STL in Stepanov and Matt Austern et al. The three containers of Hashset, Hashmap, and Hashtable were added, making this STL implementation more. It is well known that the time complexity of the red-hahead is O (logn), and the Hash structure is O (1). Of course, if implemented Help, B tree is also necessary.)

Q: Does any compiler manufacturer work with you to integrate STL into their products? A: Yes, I received a lot of manufacturers of manufacturers. Borland's Peter Becker is very large. He helped me implement allocator components that correspond to all memory modes of the Borland compiler. Symantec is intended to provide a STL implementation for their Macintosh compiler. EDISON Design Group is also helpful. We have helped from most compiler vendors. (Translator Note: In the current STL version, the best is undoubtedly SGI * STL and IBM STL for AS / 390, all STL implementations under Windows are unsatisfactory. According to test data, Windows is best STL runs on PIII 500MHz far behind and runs SGI * STL running on a 250MHz SGI workstation (IRIX operating system). Taking me personal experience, Linux is also an excellent platform running STL. And in Windows STL implementation In again, the Rogue Wave STL of Borland C Builder is the worst, and the STL in Java2.visual C in JIT execution mode is the personal work of famous master PJ Plauger, which is better, but its Queue component Efficiency is very poor, caution) Q: STL includes support for the 16-bit memory mode compiler of MS-DOS, but the current focus is obviously on the 32-bit linear memory mode (FLAT MODEL) operating system and compiler . Do you think this plan for memory mode will be effective? A: Through the architecture of Intel, the memory mode is an object, encapsulated information about the pointer: What is the integer size and distance type of this pointer, what is the related reference type, and so on. If we want to take advantage of various memory, such as persistent memory, shared memory, etc., abstract work is very important. A very beautiful feature of STL is the only part of the entire library - representing the real pointer, the real pointer, the real reference component - is packaged into approximately 16 lines of code, all other, containers, algorithms, etc. Not related to the machine (really cattle!). From the viewpoint of transplantation, all and its related things, like addressing, pointers, etc., are packaged into a tiny, very well-understood mechanism. In this way, the Allocator is not that important for STL, at least as important as the decomposition of basic data structures and algorithms.

Q: ANSI / ISO C Standards Committee believes that such problems like memory models are platform-related, and there is no specific provisions for this. Will C members will take different attitudes? why? A: I think STLs are advanced compared to C standards at this point. However, there is a significant difference between C and C . C has constructor and new operators to deal with memory mode issues, and they are part of the language. It seems that it seems that it seems that the NEW operates in the STL container to work as allocate. But now the importance of the problem is not as significant before STL appears, because in most occasions, the STL data structure will make new unemployment. Most people no longer need to assign an array because STL is more efficient in this type of thing. To know that my superstition of efficiency is not added, but I never use new in my code, and the assembly code indicates that its efficiency is higher than when using New. With the widespread use of STL, New will gradually fade out of the rivers and lakes. And STL will always remember to recycle memory, because when a container exits the scope, its destructor is called, which will destructure all things in the container. You don't have to worry about the memory of the memory. STL can dramatically reduce the need for garbage collection mechanisms. With STL containers, you can deal with what you want, you don't have to care for memory, your own STL constructor and destructor. Q: The C Standard Lubu Council is developing a standard name space (Namespace) and an exception handling mechanism. Will the STL class be a name space? Will it be different? A: Yes. Several members of the committee are considering this, and their work is very excellent.

Q: How much difference is the STL now STL with the ultimate as a standard? Will the Committee do not interfere with certain changes, will the new design will be strictly controlled? A: Most people's opinions seem to do not want to make any important changes to STL.

Q: What kind of STL experience is the programmers before becoming a standard? A: They can use the STL header file from Butler.hpl.hp.com/stl to use it in Borland and IBM or other sufficiently strong compilers. The only way to learn this programming technology is programming, look at the example, try to use this technique to program.

Q: You are working with P. J. Plauger a book of STL. What is the focus of this book? When is it? A: Plan for 95 years in summer, the focus is the detailed explanation of STL implementation technology, with his books achieved by his standard C library and standard C libraries. He is the first author of this book. The book can be used as a reference manual for STL. I hope to cooperate with BJarne to write another book, introduce the interaction of language and libraries in the background of the C / STL.

A lot of work is waiting to do. For the success of STL, people need to conduct more experimental research on this programming technology, more articles and books should help. To prepare to open such courses, write some introductory guides, develop some tools to help people roam the STL library. STL is a framework that should have a good tool to help use this framework. (Translator Note: When he said this, he did not expect what happened in the next few years. Due to the big explosion of the Internet and the huge success of Java, VB, Delphi and other languages, the center of focus on the industry From the classic software engineering domain to the Internet. Add standard C until 98, completely meet the requirements of the requirements until now, STL has not immediately become the focus of people in people. He mentioned The book is also delayed, until a few days (after 2001 New Year's Day), the book has been expected by the book, and the four masters of PJ Plauger, Alexander Stepanov, Meng Lee, David Musser, Prentice Hall is published. However, the book mainly focuses on the implementation technology of STL, and does not apply to ordinary programmers. In addition, PJ Plauger is a description: whose people are one of the early realizes of Stdio library in standard C, one of 91 years About the standard C library book made him named the world. He is now the editor of C / C Use's Journal, maintains good relationship with Microsoft, even over-intimate relationship, STL in Visual C , some content is from him. The only splendid pen. However, because the relationship with MS has affected his neutral image, there are many people who have comments on him.

As for the book of STEPANOV imagination, at least I haven't heard it. In fact, these two are typical programming bails, with Ken Thompson and Dennis Ritchie are all the way, lazy to write books, often do a second author. If the written book is definitely the first author, it is also a college, and it is similar to the standard file. It is not suitable for general programmers reading. In the field of computer science, the programming of the master is a phoenix river, the most famous may be an alien D. E. Knuth, the C field, the first mentioned Andrew Koenig. Unfortunately, our Chinese programmers saw his book. )

Q: What is the relationship between universal programming with OOP? A: One sentence, common programming is the natural continuation of OOP basic idea. What is the basic idea of ​​OOP? Separate the assembly and interface and make components have polymorphism. However, there is still an fundamental difference. OOP emphasizes the syntax of language elements in the program construction. You have to inherit, use classes, use objects, objects to pass messages. GP does not care about you inherit or do not inherit, its start is the classification of the analysis, what kind of kind, how is their behavior. That is to say, what does two things mean? How do I correctly define equal operations? Not only the equal operation is then simple, you will find "equal" in deep analysis, this general concept means that the two object parts, or at least the basic part is equal, according to this, we can have a universal equivalent operation. Among the types of objects. It is assumed that there is a sequence sequence and a set of operations for sequence sequences. So what is the semantics of these operations? From the perspective of complexity weigh, what should we provide users with sequence sequence? What operations do this kind of operation? That sorting is what we need? Only the conceptual type class of these components is clear, we can mention the problem of implementation: use templates, inherit or macro? What languages ​​and technologies are used? The basic view of GP is to separate abstract software components and their behavior standard classification. The starting point is to build real, efficient and non-dependent algorithms and data structures. Of course, the final carrier is still a language, there is no language that cannot be programmed. STL uses C , you can also implement it with ADA, use other languages ​​to implement, the result will vary, but basic things are the same. It is necessary to use two points to find and sort everywhere, and this is what people are doing. For the semantics of the container, different languages ​​bring slight differences. However, the basic difference is clearly the semantics dependent on GP, ​​as well as semantic decomposition. For example, we decided to need a component SWAP and then point out if this component is in different languages. Obviously, focus is semantics and semantic classification. The OOP emphasizes (I think it is excessively emphasized) is a clear definition of hierarchical relationship. OOP tells you how to build a hierarchy, but did not tell you the essence of these relationships. (This paragraph is not understood, there are some terms that may have to have a suitable Chinese translation for a while - Translator) Q: How do you see the future of STL and GP? A: I just mentioned that the programmer Our dreams are a standard component warehouse, which has good, easy to understand and standard interfaces. In order to achieve this, GP needs to have a special scientific as a foundation and pillar. STL starts this work to some extent, which is semantically classified for some basic components. We have to have more efforts to this, and the goal is to convert software engineering from a craft technology into engineering disciplines. This requires a classification of basic concepts, as well as some of these basic concepts, these aimings must be easily understood and mastered, and each programmer can use it correctly even clearly know that these aimings can be used correctly. Many people do not know the law at all, but as long as people go through the school, they know that 2 5 is equal to 5 2. I hope that all programmers can learn some basic semantic properties and basic operations: What does it mean? What does it mean? How to build a data structure, and so on.

转载请注明原文地址:https://www.9cbs.com/read-6665.html

New Post(0)