Note: The previous time Time Myan has a paper on the major languages, and OO and modular evaluation of 9CBS. In the interview with the parent of C , Bjarne Stroustrup talked about his own views. What can we learn from middle school through the collision of the masters think?
Slashdot interview with Bjarne Stroustrup
Glory Mahoming Translation
1. Is the development of OO a decline? (Ask questions from Rambone)
More than 20 years have passed, obvious, object-oriented programming is not "universal medicine" of a hundred diseases, what do you think about the future of OO paradigm? Do you think there is anything else to form a challenge?
Bjarne: Oh, I have understood that OOP is indeed "universal medicine", which is also C reasons for several design and programming style.
If you like Luoli's words, you can say that C is a "multi-paradigm language", but simply saying that C is a "OOPL" indefinite. To this end, I wrote a papers "Why C is more than just an object-oriented programming language (can be downloaded by my" papers page "). I showed it at the OOPSLA (Object Oriented Programming Systems, Languages, And Applications), and it is fortunate to stay.
In the first edition of "The C Programming Language", I didn't use "Object-oriented Programming", because I don't want to promote the publicity of those publicity. One of OOPs is that people who are unscrupulous are proclaimed that it is a "universal medicine". What is blowing out, it will inevitably lead to disappointment.
In other words, although OOD and OOP are my favorite design and programming, they are not a proper style for all processes. Some excellent abstract examples did not use the class hierarchies, and they were also excellently expressed. Trying to apply the class hierarchy, especially the single hierarchy, which is likely to result in indeed deformity procedures.
I use a lot of simple data abstraction (categories without inheritance) and generic programming (algorithm for template and parameterization). However, I don't think of this as a "generic challenge OOP", which are complementary technology. "Finding the design plan for the target problem" and "express design in the code" in the code "is always the key.
The combination uses a variety of styles to write very elegant code. E.g:
Void Draw_all (List
{
For_each (Lst.Begin (), Lst.end (), MEM_FUN (& Shape :: DRAW);
}
In this code, List and for_each () are examples of C standard library general facilities, which are used to call a virtual function of a base class in a traditional class hierarchy.
You can even write a Draw_all () version of a standard container for "any shape * element":
Template
Void Draw_all (Container & C)
{
For_each (c.begin (), c.end (), MEM_FUN (& Shape :: Draw));
}
I chose this example to awaken those "life in the dark age" and think that C is not a few borus of boring.
Of course, this version of Draw_all () has the same efficiency as the list traversal code, which is used to call the multi-state mechanism of shape :: DRAW () to "call via a function pointer array. Each function, this mechanism has been applied to the call to the device driver. Every year, there will be a new "model" is blown out, but most of them do not have fundamental significance, and most of them lack new. The most interesting may be those models based on "Components", such as COM and CORBA. But I can't determine if these things can form a "new model", or they are just a new system-level "build module" - do we say that the UNIX process is a new model? In summary, I have the basic view of such components: they still cannot integrate with programming languages (such as C ) and "traditional" programming models (such as OOP and generic programming).
2. Systems programming (ask questions from AJS) using C
For a long time, C has always been a UNIX world system programming language, and it will still be the case. I know that you are not willing to compare the language, so I only ask you, whether there is any essential reason, make C unable to become an excellent system programming language, or say that C-system programmer is interested?
Bjarne: Let "old guys" learn new technology is difficult.
Unix is written 25 years ago (I used it for the first time in 1973). It is defined as a C function call, array, and structure. When C is available, the C language is almost only for more than 10 years.
Unix programmers have no reasonable excuses to avoid using C . Instead, there are some good reasons to use it. However, there is a few excuses of "do not use C ", let me list a few:
C speed slow
C produces "bloated" code
Lack of excellent C compiler
C is too complex
C does not provide a lot of convenient conditions for system programmers
Advanced features of C are not suitable for system programming
C code is not portable
C no ABI (Application Binary Interfaces, Applying Binary Interface)
These excuses are either ridiculous, or they are either a large extent. Some of these reasons have a little truth for certain systems (such as mini-embedded systems that lack suitable C tools), but for UNIX / Linux, I will briefly explain the reason. Of course, a complete discussion requires hundreds of sheets of paper, as it is impossible to raise an example, in other words, it is impossible to "I don't have any problems for someone." Is impossible.
For the same program, C can generate the same excellent code as C, although try it!
C is designed to do things, the currently delivered compiler abides by this commitment.
Of course, you can write bad programs using any language. Although C is a powerful tool, it also produces obvious malformed and bloated code for it. This can be "comparable to the" traditional Italian noodles "" "traditional Italian noodles" written in the C language. It should be noted that an excellent C programmer does not automatically be an excellent C programmer. Many problems have been coming out: some excellent C programmers always think that they are casually learned to learn C language features, and they become C masters in a week. Within a week, the C programmer can indeed benefiting from C , but this is limited to a subset and library of C features.
C supports many powerful technologies, and these technologies are only weak support in C, they learn time. The programmer may also clearly remember how much time it has spent the "master" C programmer. Why is it a "master" C programmer spend short? I can't think of any reason.
The current generation C compiler is much better than a few years ago, but Optimizers is shared with C. This may lead to a problem because it excludes some meaningful optimization of the C language, but at least most of the compiler with the C shared compiler can make C can produce code with C. People cancel doubts.
I will explore the root cause of language complexity in the answer to the question 9. Here, I want to point out that many of C can directly help people write efficient, reliable and maintenance code. If you don't use these features, you may ultimately use low-order language structure to implement them.
Even those "new" or "advanced" C features, such as templates, exceptions, and runtime information (RTTI), also follow the "zero overhead" design principles. If you need these features, use them in a modern compiler than using C language to make these features more efficient (all in terms of running time and memory space). I haven't heard that any C language function is "not used" or "burden" in some systems or embedded applications.
Of course, if you don't need some type (RTTI often use it), or some characteristics do not apply in a specific situation (I can think of some programs that do not apply), you don't need them. The "zero overhead" principle allows you to make such a decision. This and "There is no different C language characteristic in a given application (for example, in some embedded systems, it is disabled from using malloc ())" no different.
C has the same portability as C. In both cases, you need to package "system dependencies" to transplant. Large programs can be transplanted between UNIX platforms, and some programs can also be transplanted across other platforms. These technologies are widely known, and when they have good application, C is formally formulated in the aspect of "forming the system concept of painless transplantation", and even has an advantage. To see an example, you can refer to the C library of "Defining the ACE Platform" (there is a link on my C webpage).
C lacks binary interface (ABI), the most difficult solution may not be. There is no ABI, but in the vast majority (or all?) UNIX platform, there is a compiler of "dominating status", other compilers want "useful", they must comply with its call agreement and structural layout. rule. In C , there are more "variables", such as the layout of the virtual function table, so there is no manufacturer to be approved as C to create "all competitive vendors must follow" ABI. The same truth, the previous connection (LINK) is also impossible to generate the code generated by the C compiler on different PCs, so it is generally not possible to connect two different Unix C compilers - unless there is a compatibility switch. The current solution is usually used in combination with "using a single compiler" with "providing C level interface". This is not ideal, please refer to my answer to the question 10.
In other words, I think the most important issue is "education". For "What is C " and "what it can be used", many people's views have serious mistakes. The wrong view often accumulates a serious obstacle to learning. The current C has been larger than the first edition of 1985, and the C ISO standard was approved in 1998. For me, the current compiler is enough close to the standard. I can use programs that use newer functions to transplant between compilers to perform performance tests on a variety of platforms, which are not available.
3. What do you think of different design? (Ask questions from spiralx)
What changes do you make when you can go back to your design C ? why?
Bjarne: We can never return to the past. However, I think my most obvious mistake is: I have not introduced into the template before introducing multiple inheritance; I have not been able to match a larger library in the first edition of the C compiler. These two mistakes are relevant to some extent.
I have not delivered a library because I don't know how to write a good enough library. To make the container efficiently and safe, we need to use templates, but until 1988 or 1989 I get a support template compiler. But only the template is still not enough, we also need a "can bring security" for the container and container usage. We have such an architecture until Alex Stepanov brings STL. If you want to teach these interesting ideas and wise views, you can read this interview with Alex. STL is the core of the C standard library, which provides standard containers and algorithms, and provides their usage and "expanding the user-defined container and algorithm" framework. Naturally, "The C Programming Language discussed this.
One consequence of the introduction of MI preceding the template is a further abuse of the class hierarchy. For some of the more malformed applications in the inheritance mechanism, templates provide a simple and efficient alternative.
Let me talk about what I will not modify even when I turn down. - Compatibility. Even if the C language is not the best compatible candidate, I will also choose to be compatible with some other languages. "Innovation" should focus on "improvement", and those things that should be customary should remain unchanged. In this way, people can continue to use existing tools and technologies, or they can be developed on the basis of functional industry, and they can also avoid "reinventing the wheel", nor does it need to repeat the "new" content that is similar to the old content. . Therefore, C is approaching C - but cannot be closer. The other side of this issue is: You must handle those old errors and compatibility issues. For example, I think C's statement is a failure, but I still adopted it in C . When I think the workaround and improvement methods do not make the situation improve. But I think this is a secondary problem, more serious problem is how C is "approaching" with C .
Also, even if you reflect, I will not remove any big language characteristics from standard C . Adding new large language features must also be cautious. It is believed that it is necessary to change the functionality that can be implemented, often using the library.
I think the C Standards Committee has done a great job. It is not easy to reach a consensus for a norm. Business competition companies must reach a consistent opinion, but also to satisfy the countries of standard traditional conflicts. However, I don't think that all time and efforts have not been in vain. Standard C is more close to my ideals than any previous versions, and it is also accompanied by a great standard library. These times and efforts are indispensable - unless you want to be dominated by "facts" and "proprietary language". My third edition "TC PL" tells the ISO standard C , and the current C compiler is close to this standard.
4. Why not Templated TypeDefs? (Ask questions from Venomous Louse)
Oh, it's not integrated, this is the guy who I want to find this morning!
TYPEDEF TEMPLATES (or Template Typedefs? God!) Sometimes it can make a convenience, as shown below:
Template
... But this seems to be inevitable, I can't think of anything that I have seen about such problems in "The Design and Evolution Of C ". What should I do?
Bjarne: I have the Standards Committee, underestimating the importance of Templated Typedefs, I guess it will add it in the future.
In fact, D & E (p. 357) has discussed Templated Typedefs and proposed a common alternative technology:
This expansion is negligible in technology, but I can't determine how wisely introduced another rename characteristic.
When defining a new type, you can also use the derived mechanism to partial specification: Partial Specification:
Template
Template
I guess, in this case, "I don't want to add new features that have no clear practical application requirements" leads to problems, but I am more often accused of opposite errors (too active addition characteristics). However, after people learn the use of existing features, new demands based on new experience began to emerge. By the way, your example - a function of accepting parameter t and returns a BOOL value, often can be manifested by function objects (Function Object). And the function object is born is template:
Template
Struct predicate {
BOOL Operator () (Const T & R) {/ * ... * /};
}
In this way, you don't need Typedef, just write this:
Predicate
Function objects are also better than the function pointer in line inline, so use them to write clean and fast code.
In general, I recommend people who have questions that "why it is or not such" in C is reading "The Design and Evolution of C " book.
5. Question ... (ask by MRHAT)
I (probably we have most people) understand you just through your creation of C languages, and your assistance to write C language ANSI standards.
In addition to this project (although very huge), what work is you still doing? What item is currently in? Do you still have more language definitions or standards?
Bjarne: C related work is a large part of my daily work. Although the C standard is currently "maintenance mode", it still needs to be put into attention. I did some work related to the library and programming technology (this year later, I will publish an article on "Wrappers" papers on "Wrappers"). C education and "misleaded programmers often have C " also make me worry. Please refer to the article I wrote "to learn the standard C as a new language" (can be downloaded from my papers page). As you can see, I also conducted some writing, speaking and interviewed.
In the Standard Board, I will spend most of the time in Performance Working Group. The purpose of establishing this group was to investigate the source of efficiency and study the implementation and programming technology of "rescue" inferior code. One of the needs of this work is an embedded system. The current language makes "near-optimized solutions" possible, but not all compilers can achieve the degree of efficiency, and not every programmer is a basic technique of writing compact and efficient code.
As always, there are still many discussions on language expansion and new libraries on the Internet, but the C community still does not learn how to make full use of new convenience facilities. I think we can get a lot of benefits from excellent libraries. Standard libraries and STL demonstrate some things you can do from a general perspective and a special perspective, respectively. In the end, some new libraries will be standardized.
I am trying to improve the level of cognition of distributed computing. To this end, I read a lot of things and tried some little things. The content I am concerned includes migration, reliability, fault tolerance, and security. These research areas are also "leading to the design of C " research field, so in a sense, I returned to the system (Systems "hometown. As a manager in the AT & T Laboratory, it is necessary to spend a certain amount of time, but may not be as much as you think, and it doesn't look like a real job - in that position, I don't write code or write Technical literature. 6. Multiple inheritance (ask questions from Moseesjones)
There are three interrelated issues:
Do you think multiple inheritance is necessary for a true OO language?
When using multiple inheritance design systems, do you think it needs to avoid which traps (especially in terms of maintainability)?
What measures do you think can simplify multiple inheritance to reduce the dangerous action of novice might do?
Bjarne: If you rely on static (compile period) type check, you will need MI. If there is no MI, many programs will be "distorted, and you will have to frequently use explicit transformation (Casting) frequently. I won't claim that I know what is "a real OO language" (even if there is such a language), however, if you must always use Explicit Type Inquiry, you use it. Not a real OO language.
I don't think MI is a particularly serious source of trap. The obvious problem with MI and single inheritance and any other powerful language characteristics are abused. I tend to use MI in a simple aggregation and implement multiple interfaces, for example:
Class network_file_ error: public network_error, public file_error {
// ...
}
and also
Class Interface {// Abstract Class
// Pure Virtual Functions
}
Class base_implementation {// useful functionality
// Data, Functions, Virtual Functions
}
Class my_implementation: public interface, protected base_implementation {
// Data, Functions
// Override Some Base_IMplementation functions
// Override All Interface Functions
}
In the latter example, you can let the user access my_implement through a pointer or reference pointing to the interface. This allows the user code to not depend on "Implementation Class" and the system will not encounter the so-called "fragile base class" problem. "Implementation class" can be replaced into an improved version without recompiling user code (except MY_IMPLEMENTATION itself).
Follow these two styles to avoid most of the issues. Of course, you can find a broader discussion in the "THE C Programming Language" third edition and special edition. (To learn more, style or comments, please visit my personal home page.)
In fact, the problem with MI usually means that the questioner has lost in the technical details. For almost all programs, the use of abstract classes, templates, abnormalities, and standard libraries are far more than their incurns. In a static type of static type with inheritance, MI is essential, but it does not belong to those that should be used frequently. Define a concrete class to indicate a simple type, define abstract classes to represent the primary interface, if you focus on this, you may have a good design. So, doing a program may need to use MI, but it is obviously a beautiful solution when it is really needed.
7. Problem (ask questions from Edward Kmett)
"Constrained Templates" Is there hope to be introduced into C ? For programmers, the current use template is a matter of tempering perseverance. I heard that at the beginning of the introduction of the template, "constrained genericity" has appeared in the Standard Commission, is there any idea to think about the decision?
Another problem is "Design By Contract" from the Eiffel Community ", I hope to see it gradually incorporated into C standards, but I suspect that I can't think about it.
Finally, Mr. Bjarne, you said, "When you can use the reference count in C (not" if you can ... "), it will be an optional technology," The book on object-oriented programming language has been quoted (but I have not found this book on Amazon at this moment). Is there a significant progress in the cutting edge of the counting object technology? Since your words are quoted, do you have any changes?
Bjarne: In fact, I am mostly said that when the automatic garbage collection is part of C (rather than "false garbage collection mechanism ..."), it will be a kind Optional technique.
For resources that are not very high in use, "reference count" may be very useful, but I don't advocate it as a general mechanism of "tracking memory". C has a good memory management mechanism (such as constructors, destructors, and standard library containers), but if you need more "automatic", plugging in is a useable garbage collector (Garbage Collectors) is an appropriate select. (Refer to "The C Programming Language" C.9.1, my C web page or my faq.)
By the way, the ISBN of the hardcover special edition "TC PL" is 0-201-700735, and the ISBN of the pileup third edition is 0-201-889544.
Constraints on the template and do not make it capable, which is not as simple as it sounds. See D & E for more discussion details. One of the problems is that if you express the template parameter constraint according to the base class, you will make your system design to the "property" as a base class as a base class. This is very easy to cause abuse of multiple inheritance and indirect expression of "Original Direct expression". For example, say "A class must have a << operator" ratio "must inherit from 'Printable' (in order to have a << operator)" clearer. Expressing more direct code, which is more short, and the generated code is better than "adding a base class to express a constraint". Specialization and Partial Spectialization mechanism provide many expressions that wish to get from Constraints. For example, if I have a universal sort function template
Template
I also want to provide a special sort algorithm for the Vector, then you can write:
Template
I welcome the error message provided by Templates with Type Erroes with type error mechanisms. Some of them can be achieved by better compiler technology (people are working hard), some information requires a template parameter constraint or check to do, but I don't know how to do this. Fortunately, programmers can help. Consider the example given when answering questions 1:
Template
Void Draw_all (Container & C)
{
For_each (c.begin (), c.end (), MEM_FUN (& Shape :: Draw));
}
If there is a type error, it will occur when there is a fairly complex for_each () call resolution (resolution). For example, if the element type in the container is int, then we will get some kind of error message associated with calling for_each () (because we cannot call Shape :: Draw ()).
The code I have written is actually as follows:
Template
Void Draw_all (Container & C)
{
Shape * p = c.front (); // accept Only Shape * S
For_each (c.begin (), c.end (), MEM_FUN (& Shape :: Draw));
}
When the useless variable "P" is initialized, most compilers will trigger an error message that is easy to understand. Similar to this technique is very common in all languages and has been developed for all novel constructs. In "Product Code", I may write this:
Template
Void Draw_all (Container & C)
{
Typedef Typename Container :: Value_Type T;
Assert_equiv
For_each (c.begin (), c.end (), MEM_FUN (& Shape :: Draw));
}
I used an assert to make it clearer. I left Assert_equiv () as an exercise to reader J This introduced the second part of the problem - the use of "Design by Contract". Since "Design By Contract" is a design style, you can use it in C . To do this, you need to use assertions systematically. I personally tend to rely on some "Specialized Assert Templates" (see "TC PL" third edition). I also think that some templates such as "part of the library are all excellent candidates."
However, I don't think language will directly support things similar to Preconditions and Postconditions, and I don't think preconditions and postconditions written in nature of the same language inquiry are significant improvements to Asserts (). Also, I suspect whether the class hierarchy is checked (language supported Conditions already provided) is worth it. By systematically use assertions in current standard C , people can get a very significant benefit today.
8) A smart problem (haha!) (Ask questions from JD)
From the perspective of software engineering, C is an object-based language rather than a purely object-oriented language. However, it still focuses on object concepts, not the process of procedures.
However, all existing processors are procedural, and there is no true OO CPU.
You think OO languages, such as C , will it lead to the production of the OO system at the hardware level? Or always limit OO ideas at an abstract level, and achieve translation between "OO" and "process modification" through extremely complex compilers, is this simple?
Bjarne: Before designing C , one of my work is the architecture that directly supports the "high-order" function. I got a conclusion: With the rapid reduction in hardware, the speed is accelerated, and the software-based plan is better than the high-end hardware. These superior points are overhead, elastic, potential users, and "software can run in their" computer's life (design and building a high-end machine than a traditional machine spending long).
In the foreseeable future, the "Mapping of high-order structures to low-order hardware primitives" by compiler will still dominate.
9. C complexity vs. OOP simplicity (ask questions from Hanwen)
First, I apologize for those possible "ignition ignition" in this issue.
How do you explain the relationship between the current C complexity and the simplicity of object-oriented programming? The following is a more detailed description of this issue:
In recent years, C achieves rapid expansion. If I have not remembered, your book "TC PL" has doubled more than one. C has become a large, extremely complex language, I suspect whether there is any individual (except for you), you can get all the definitions, not to say the programmer in the team.
This means that in any project, it is unrealistic to fully use C , and will definitely limit the strict "guidelines" to a project to limit which features can be used, which cannot be used. From this perspective, "C makes software development more easily" is worthy of doubts. So I think that as a tool that is more efficiently written, C is a loser. C evolution is driven by several "Motto" (you don't have to pay for the things you don't use, and C-compatible, wait), from this perspective, C is successful, do you think these "Motto" needs Reconnect?
Bjarne: ignition ignition? I think you are very polite and very professional - your "editor or educator (editor / modelator)" removes the true extension J
Some degree of complexity is inevitable, I think "I have a strong and commonly used technology in the language" in the language "is an excellent idea (otherwise I won't do this." Have you seen the C code that imitates the "class hierarchy", "parameterized type" or "exception"? This type of code tends to make pointers, transformation (casters) and macros. In C , this class code can be cleaned and simply expressed. Vocative is that these configurations have a semantic semantic, not just some comments for code intent. In this way, the complexity is transferred from the code to the language definition itself (and the compiler).
You think is not necessary to use all of C in each project, which is correct. However, this does not mean that you need to impose some restrictive "guidelines". When did you explicitly use all the features of UNIX or NT in a project? You want an administrator to tell you how to use which features should be used? They have nothing to do with specific projects.
Typical "guidelines" obviously come from the "Dark Age", which is based on "the state of the world" and "what is complicated, what is not complicated", and has a false assumption. Those who have developed these guidelines will definitely say that from the whole, the educational institution is very poor in "Key Programming Technologies that makes students' key learning C ". The consequences have led to a doping of "chaotic C style code" and "over-bloated SMALLTALK style". A large amount of use of the transformation (CASTS) and macros is the universal common point of non-optimization using C .
I have seen many successful C projects (far more than failure) and "good" to C . The word "good" means: elegant, efficient, reliable and maintenance. Therefore, in many people, C has indeed reached the expected design effect. Keep in mind that I only have a little clear, "Well-Document" (see "D & E" and "The C Programming Language"). I am not the effectiveness of the business OO scam.
I think I understand that "C 's success use" and "Respect C limitations (applied to the 'design' deeply thinking)" and "actively make design ideas to provide functionality" interrelationships between the relationships. For example, if you construct a hierarchical hierarchy, you will refuse to use the abstraction class and define a lot of data members at each layer. You really shouldn't be surprised to compile the length of compilation, and need to understand. What is the problem that something is defined? Similarly, if you don't use C features, use C style strings, arrays, plain structs, and a lot of pointers to low-order data structures, you shouldn't be surprised. The benefits of encountering a C style rather than get C . The main counseling content of C language is 186 in the first edition of TC PL. The second edition has 282 pages, and the third edition has 360 pages. The "increased portion" is to further emphasize programming technology. Other reasons for the number of book pages (from the first edition 327 to the latest special edition 1040) are to describe more programming and design technology and standard library information. "Special Edition" spent 363 tells the standard library, which does not include the standard library application sample program for other parts of the book.
10) Remove Bjarne problem (ask questions from Scherrey)
In 1989, I brought me into C world through BIX Online Service, you and Greg Comeau, at that time, the two start demonstrations (and eventually made me convincing) OO is not a prestigious fanatic, and C language can efficiently implement OO. The "COMPUTER LANGUAGE" magazine is open. The "Month Language" feature column is being opened. At that time, there was a trend of "coming to hurry, and hurried".
In my impression, you emphasize the following two main goals: a. Build a language that can handle the giant projects that are difficult to deal with those C language; b. In "characteristics" and "efficiency" to achieve a balance Therefore, the developer has to pay for him.
With my personal experience in C use experience in an extremely varied project (including very "restricted" embedded system and large cross-platform enterprise-level system, the first goal has achieved significant progress And the second goal may have been fully reached.
However, what is the most disappointing thing, lacking the ability of "using C completely replaces the old-often C" in system-level development, which is the most domino in the abstract characteristics of the language, and this is also you One of the language objectives declared. The realization technology of the virtual function, inheritance resolution, is very "empiric" nature, so I know that I know the standard ABI (Application Binary Interface, application binary interface) in the early days. Nowadays, it has been a strongest standard, and a strong standard has also been introduced, and the differences in these implementations are more "artificial" than architectural considerations.
Today, open source movement is in full swing in business and non-commercial. Unfortunately, C cannot be used to provide a connected API (Linkable API) unless downgrade to strictly restricted C-type connections, or forces all users who call your library and the same compiler you use - because there is no Standards for structural and calling agreed.
Do you think it should be given to the standardization of ABI now? If this is the case, what mechanism will be used to define these interfaces (in fact standard VS. regular standards, etc.)? Who is doing this job, and what kind of work can promote the development of this technology? Bjarne: Ben, hello.
I think I have achieved efficiency, universal, and some degree of elegant, however, I underestimated the Linker's question, I may also underestimate the problem of breeding because C is compatible with C.
If I am a platform provider, I will give priority to implementation C ABI for a few years. When the compiler is highly compliant, all manufacturers based on my platform will provide with me. As far as I understand, such work has been made by Sun Company (for SPARC systems) and a group of MERCED architecture for Intel companies (IA-64, please visit http://reality.sgi.com/dehnert_engr/cxx/) The supplier is launched.
I will encourage everyone - especially those who write "an integral part of collaborative results" to promote this platform ABI standard. If you are in such people, please lobby for C ABI on your favorite platform. Unfortunately, I can't provide specific recommendations for how to do this.
Although the high-level abstraction mechanisms expressed in class or template are much better, "" In the system interface layer and C are compatible ", people have already used C-style strings, arrays, and structures. They not only have low-level tools within the implementation of system layers and classes, but let low-level structures and their pointers are designed. Obvious consequences are type errors, "Wild Pointers, array crosses errors, and memory leaks. A large number of macros and transformation (CASTS) make the code more embarrassed. I feel sorrowful in the chaos that people caught in some cases.
Part of the reason for the problem lies in poor education. Good education must be part of the solution, but education can only play such a big role. Before we expect "novice" to rush out of the C subset and use more powerful technology, the library and tools that use modern C ideas must be blooming everywhere.
People should realize that the entry of C is easier than the entry of C. The "best initial subset" to learn is not "the most of the fact that" C learning curve is much smoothed as compared with usual situation. For further discussion, please refer to "Learn Standard C as a New Language" (available from my papers web page).
We have been using the application software written by C and specialized librascities to provide programmers with a high-order work environment. One of the significance of a standard library is to provide such an example for everyone. Use standard convenience facilities (such as String, Vector, MAP, and algorithms) to write code, you can change people's programming methods and thinking about programming. I hope to see that technology for definition and implementation of standard libraries is also applied to many other areas, resulting in the same benefits - whether in terms of source size, type security, code clarity, or runtime efficiency.
I think the more and more interesting part of the test standard C has come. For example, I wrote a new supplementary material, Standard-Library Exception Handling showed a programming style, which more significantly violates "C's universal knowledge", but it can make the code more simple. Although this article is not written for a newcomer, it can work from the internal operation of the standard library.
Of course, we must be more cautious about "product code" because they have higher requirements for the compatibility of the old code. However, we should not be in old style or compatible issues, so that we don't dare to try more modern, more efficient style. Now there is a native C style (Native C Styles), we should use them. Some additional comments
Comment of Coward's Anonymous
This is really interesting things, I will forward every person from here.
I only mention a "negative" question: Does he really need to mention his book many times? It seems that he has never missed it. "Please refer to the opportunity of my third edition" TC PL "", I often don't trust those who mention themselves or their products.
Of course, this problem is negligible, thanks to this wonderful interview.
Bjarne: It is conceivable to make a broadcast interview on a serious painter or sculptor. For such an artist, the truly important thing is his (or her) work, but it is impossible to show these works through broadcasting. You will expect many museums about works and "people can visit these works". Reference Information. Descriptive words are absolutely not enough. The poor artist may transfer the discussion topics from the work to private life or political views as a privilege, but the serious artists will not do this.
Although I am not an artist, there is a similar problem with such an interview. I want to showcase the code and serious discussions on the problem, but "Q & A (Q & A) method makes me unable to do this. My solution is to quote the work I have published and my personal home page.
After all, the work I have published is the primary C resource. So I can say calmly, if you want to learn more, please visit my personal home page, read "TC PL", "D & E" or my papers.
C and scientific calculations (comments from J. Chrysostom)
As a student who is about to graduate, I am very doubtful. Why is C support for mathematics and scientific calculations, and Fortran, the ugly and uncontrolled "beast" is the only "safe" ".
Bjarne: Take a look at the link to the C numerical calculation library (such as Blitz , Pooma, MTL, and ROOT), you may also track some of the other C numerical calculations.
Davorama's comment
These problems are so unusual, so that I can't make an idea, maybe you can provide some ideas?
How do you think template meta programming? Do you think it is a "gift" that makes smart programmers can make things like Blitz projects? Or is it the convenience of its convenience is completely coded by its implementation code of its "embarrassing or even never understand"?
Bjarne: I really like some things that use C for numerical calculations. Common ideas is that templates can be used to eliminate those pseudo contemporary objects. The results are often defeated with their own game rules, while also maintaining specifications of mathematical marks. On my personal homepage, you can see the following link: Pooma from LANL, Blitz from Warterloo U., from the NOTRE DAME MTL. "TC PL" is explained in the chapter of the numerical calculation in this area.
I think the complexity of implementing code is difficult to understand. In fact, I think those code is much better than others (such as C core code). When the head is important, you should not understand how difficult it is to understand the optimization technology. After all, if you are a real user, you don't have to read their implementation code. SETHG's comment
There seems to have a universal subject in the answer, ie "Those complaints are time-based information, please use the new compiler and STL of the standard."
Does anyone maintain a chart for our C novice, show which sections of the C compiler currently violate the C standard file?
Bjarne: A rough answer: The compiler of larger vendors is quite compliant with standards (I use them), such as Borland, GNU, Metrowerks, Microsoft, and SGI.
For more detailed information, please refer to the list of LANLs (there is a link to the POOMA site on my C webpage), or refer to a New Zealand site trying to track such information. Some vendors, such as Borland, published the results of the Plum Hall assessment on their websites.
Also, what you said, I think the problem reported for C has a big proportion that can be due to "misunderstanding" and "misuse". "There is a modern C compiler" is a prerequisite for some technologies I suggested, but please don't think that a new compiler itself brings more help. You need to truly change your way, unfortunately, there are too many factors in the real world that make this change difficult to achieve (legacy code, lack of learning new technologies, multi-person collaboration, and outdated style rules). I didn't say this is very easy, I just said this, and many people have achieved success.
Hanwen's comment
Maybe today's standard library can alleviate some of my distress, but I don't want to learn such a large C component, and because I know so, C is still not good enough. Will it support reflection, high order function (HIGHER ORDER FUNCTIONS, Garbage Recycling? .
This seems that I found that your "Getting Started with C is easy to get to C" is dangerous. This is also the example in "learning the standard C as a new language". Because they implicit any one in the two languages or should be a "entry" language.
One language, distinguishability to Non-Immediate Objects on the stack and stack, no automatic garbage collection mechanism, allowing the use of pointers, no initialization mechanism, no "higher-order" content, you do I hope people grow as such a language?
You educate people about C : and the wrong thought struggle, tell them where to apply C . However, you have not told them where they don't apply C . C is widely popular, and people are easy to produce such misunderstandings: C is an excellent programming language, or C is a language suitable for writing very and smart programs, and so on.
Bjarne: In fact, you are right. I think it is noticeable to let people learn a language "when they graduate." The Functional Language programming language is not mainstream of the auto-garbage collection mechanism and high-order (Higher-Order), although they have college-oriented and educational institutions more than 20 years of enthusiasm. Obviously, I think that people use low-order languages like C are also not ideal. In view of the bad situation of current programming and design teaching, C may achieve a big progress. Of course, people may not benefit from the abstract mechanism of C , but degraded to something equivalent to assembly code using C or C . Through STL, C community may have made more people to solve the functional programming technology, perhaps the C community has applied such technologies to real problems, more than the previous language. . Function Objects is not the most elastic closure (CLOSIRES), but this does not affect this fact: people understand, like and use them.
"Learn Standard C as a new language" (there is a link on my papers page) clearly states the scope of these methods and discusses the reason. Look at C in 1988, it doesn't have templates, exceptions, RTTI and standard libraries. It is indeed a different language - a language that does not support most modern C technology.
If you need a garbage collection mechanism, a great free or commercially supported C garbage collector can be used (see the link on my C webpage). The reason why the C garbage collector is so efficient, that is, the C differentiates objects disposed on the stack and the objects disposed in the free storage area.
Comments on anonymous people surnamed Coward
Ah, it is this guy, he once tanched with this name to name his new language, but also said that K & R's C language is "Old C" in AT & T ... until Dennis Ritchie called him.
I thought he had to admit that the Committee helped him settle a lot of problems in this early versions, and I also thought that he would not claim that the current C is flawless.
Given his success and awareness, maybe I am a little arrogant, J
Bjarne: I don't really think that I am extremely lack of humility.
You know, I have more than ten years with Dennis (although not very close) has more than ten years. I don't think I have used the name "C", even if it is so, no one will pay for me.
Speaking that C language is "Old C" people are not me. In order to clarify confusion and avoid damage to Dennis reputation, it is "C " for "C with Classes".
Similarly, I am very hard in the committee (very many language designers "boring," I also believe that the Committee has done a good job.
-Finish-