Reading Notes (1)

Source: Internet
Author: User
Document directory
  • 1. Terms of Words and Phrases
  • 2. Statements
  • C ++ is very spam for Linux.
First reading this book

When I read some so-called classical books about programming languages, I think it is indeed much better than general books. I not only talked about how to use a certain language feature, but also explained why it is used in that way. we should not only know how to do that, but also know why to do that more thoroughly. when we know why to design a language feature, we will think that there will be multiple choices and trade-offs for a purpose. Why does the language designer choose one of them? Many so-called classic descriptions about why to do are simple and will not be explained in depth. this is not to demand them, because the main purpose of such books is to teach you how to familiarize yourself with the use of programming languages. It is good to talk about some why.

<The design and evolution of c ++> written by Bjarne stroustrup, the father of C ++ (generally translated as the design and evolution of C ++)
As the name suggests, this book is more about why to do. why design some language features in that way. I think this book is a classic one. in all the books I have read about a specific programming language, I think this one is the best. the book that impressed me the most. so I can't help writing some reading notes.

 Next I will extract some stroustrup words out of context, and then add my own feelings. of course, such a book must be intensive and read more. maybe it will be different when I look at this book later. this is just my first thought. for more original taste, I see the English version. I can also simply translate the excerpt (it is definitely translated by myself, but it is not copied .)

 

Digress, views on translation of books in Chinese and English

When reading a book, if we can see the original version, it would be better to see the translation. I think the most obvious difference between the translation version and the original version is the following two:

1. Terms of Words and Phrases

We know different languages, such as Chinese, English, Japanese, and French. the ideas of table talents are similar to the ability to describe things. otherwise there will be no translation in the world. however, each language differs in implementation details. words used in one language do not necessarily have one-to-one corresponding words in another language. you can only use free translation to find similar meanings. therefore, translation is more technically difficult. You must have a better understanding of the culture behind the two languages, only by having a good understanding of the professional knowledge involved in books can we translate high-quality books.

Words like computers, physics, and chemistry are perfect words for translation. the original meaning is well conveyed and can be defined as the name suggests. COMPUTER: a computer that can work only when it sees electricity is an electric machine. It indicates a smart machine.

Physics: the theory of thinking about everything. It covers all things in the world. Chemistry: the theory of changing things. In fact, chemistry can be physical in a broad sense.

However, intellectual is a bad translation term. this word is translated as an intellectual. the concept of intellectuals has a great impact on our lives and education. we think that the more things we remember, the more knowledge we have, and the more intelligent we are. our education tends to make students remember a lot of things. in fact, the intention of intellectual should be to have strong thinking ability, understanding ability, and understanding ability. so there is a saying that the essence of education is what you leave when you forget everything you have learned. what is actually left behind is thinking ability. from this perspective, there are not many intellectuals in the eyes of foreigners in China.

2. Statements

We know that a lot of English statements and Chinese statements seem to be upside down. in Chinese, the emphasis is placed on the back, and all the modifiers are placed on the front. in contrast, English tends to focus on the front, and many unimportant modifiers are put behind, all of which are represented by definitions. this makes it easy for us to grasp the key points.

In addition, there are many prepositions, hyphens, and many long sentences are organized by some prepositions. the structure is rigorous to express some complicated but interrelated ideas. chinese translation often becomes many short sentences, and the links between sentences become loose.

Interestingly, there is a branch in psychology called Language Psychology, which specifically studies the influence of different points in language on people's thoughts. for example, there are many nouns and adjectives in Chinese, so people who often use Chinese tend to think more and understand the world with experience and feeling. however, many English intermediary words are used in conjunction, and the logical ability of people who often use English is strong, because the logical connection between things is often reflected by the prepositions and hyphens.

 

 

<C ++ design and evolution> original text excerpt and comments

Original article:

1. c ++ was deisgned to provide Simula's facilities for program organization together with C's efficiency and flexibility for systems programming.

C ++ is designed to provide the program organization function of simula while maintaining the efficiency and flexibility of C.

 

Note:The concept of a class is introduced in Simula. one of the major functions of the class is that it can be divided into many modules and the code can be well organized. like C, you can get some operations into a function to form a module. classes further organize many functions and variables (including other classes) together. aside from the advantages of other classes, it is strong enough to organize code well. in addition, C ++ does not want to lose the advantages of C's efficiency and flexibility.

 

Original

2. However, the details of a language definition are incomprehensible without an understanding of the purpose of the language. The language, details and all, exist to help build programs.

However, if you do not understand the purpose of the language, it is difficult to fully understand all the details of the language. All the details of the language and all other functions, they exist in order to write a program.

 

Note:When learning a programming language, if we don't know why it is designed like that (why to do), it is hard for us to use it flexibly (how to do ). the emergence of a programming language is often based on some actual needs to meet some specific problems in programming. not for fun, but for academic and conceptual perfection. for example, we use natural languages such as English and Chinese. they have many standards and complete syntaxes. from an academic point of view, it is perfect. however, in real life, we often use omissions or sentences if we do not fully follow the syntax. for example, one of the biggest and best Chinese people love to talk about. in fact, this is obviously a sentence. however, the language is used for practical purposes. As long as we can achieve what we want, why strictly follow the syntax?

The same is true for programming languages. For example, object-oriented is a wonderful idea. however, sometimes we may use process-oriented ideas to implement some problems. in this case, object-oriented has become a constraint. so we need to take specific measures based on specific situations. each programming language has its own expertise.

 

Original

3. thereby, I have reaffirmed a long-standing and stronugly held view: Language comparison are rarely meaningful and even less often fair. A good comparison of major programming requires more effort than most people are willing to spend, experience in a wide
Range of application areas, a rigid maintenance of a detached and impartial point of view, and a sense of fairness. I do not have the time, and as the designer of C ++, my impartiality wowould never be fully credible.

I also worry about a phenomenon I have repeateddy observed in honest attempts at language comparisons. the authors try hard to be impartial, but are hopelessly biased by focusing on a single application, a single style of programming, or a single culture
Among programmers. worse, when one language is significantly better known than others, a subtle shift in perspective occurs: flaws in the well-known language are deemed minor and simple workaounds are presented, whereas similar flaws in other ages. are deemed
Fundamental. Often the workarounds commonly used in the less-well-known ages are simply unknown to the people doing the comparison or deemed unsatisfactory because they wocould be unworkable in the more familiar language.

Similarly, information about the well-known language tends to be completely up-to-date, whereas for the less-known language, the authors rely on several-year-old information. for language that are worth comparing, a comparison of language X as defined three
Years ago. language y as it appears in the latest experimental implementation is neither fair nor informative. thus, I restrict my comments about ages other than C ++ to generalities and to very specific comments. this is a book about C ++, its design, and
The factors that shaped it's evolution.

Here I reiterate my persistent point of view that comparison between different languages is meaningless and sometimes unfair. if you really want to make a better comparison of the main features of different languages, you need to make great efforts. This is much more than most people think. this requires rich experience in various application fields and a sense of absolute neutrality and impartiality. I don't have much time to spend on different languages, and as a C ++ designer, my fairness to other languages is always hard to convince everyone.

In addition, I am also worried about this phenomenon. This is also a phenomenon that I have seen many times when people want to compare different languages fairly. this phenomenon is: Those who are compared are trying to keep themselves fair, but in the end they don't know because they only focus on one application, one style, A certain type of programmer culture eventually shows bias. when comparing a commonly used programming language with a non-Commonly Used programming language, there is also a worse situation. an imperceptible bias will occur: some defects in common languages will be underestimated, and we will think of some suitable solutions. however, similar defects in uncommon languages will be exaggerated. in addition, the comparison may not be aware of the appropriate solutions in uncommon languages. even if you know the solution, you may think this method is not good by analogy with the common words.

Similar to the above bias, the comparison compares the latest information of a commonly used language with the information of a few years ago from a non-commonly used language. for example, for a comparable language, if there is language X, the information about it is three years ago, with language y, the information about it is the latest technology from the lab. this comparison is neither fair nor meaningless. therefore, some comparisons in my book about C ++ and other languages are only generalized or strictly restricted to a specific view.

 

Note:Ah, this article translated and found that many places were inaccurate. I can only translate the approximate meaning. the author's general meaning is that comparing the advantages and disadvantages of different programming languages does not make much sense. Second, it is difficult to be fair and prone to bias.

C ++ is very spam for Linux.

Perhaps the most interesting thing is that after writing this article many years ago, stroustrup's self-designed C ++ was taken and compared with C, it was approved as a spam language. in addition, this is not a common person, but a well-known Linux. in fact, we can still use the above arguments to comment on this question. first of all, for Linux, he must be more familiar with C and has written many programs in C. c ++ may only be familiar with syntax, but it is hard to use C ++ to develop some applications in many fields because it is annoying. we know that the purpose of C ++ design is to meet some actual needs. if C ++ is not used in various applications in various fields, it may not be easy to understand its advantages. in addition, Linux is famous for developing operating systems. It is more often close to computer hardware. How can we use efficient algorithms and methods to make full use of hardware resources. however, less consideration is given to applications. More attention is given to how to model business processes and abstract them into a data model. This is easier to design, it is easier for developers to write and organize code.
Therefore, during application development, it is worthwhile to waste some hardware resources for convenience and make the hardware more active. in terms of efficiency and flexibility, C ++ will naturally be less efficient than C, but it will not be much worse. therefore, from an academic point of view, some designs of C ++ may not be as good as C, but C ++ is more practical in many places. like your Linux operating system, it is more technically powerful than windows. but in fact, most of us still use Windows instead of Linux. although there are some commercial reasons. however, there are too many Linux instances for machine consideration, not for human consideration. person-days are relatively lazy, all of which are more practical and easy to understand.

From the perspective of Linux, he thinks C ++ is probably right. but from the perspective of others, C ++ may be better, while C is more junk. in fact, it is meaningless to compare the quality of the two languages in stroustrup. of course, if it is only limited to a certain aspect, I think it is still useful. You can use the Stone of his mountain to attack the jade and learn from each other. the programming language is also evolving. use C # For example. at the beginning, it was not generic, and it would be really difficult to use, and few people were using it. it is much more convenient to have a generic type later. later I Came Up With lambda expressions, a little functional programming flavor, and then what kind of dynamic type...

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.