tailieunhanh - Lecture Programming principles and practice using C++: Chapter 8 - Bjarne Stroustrup
This lecture and the following present some technical details of the language to give a slightly broader view of C++’s basic facilities and to provide a more systematic view of those facilities. This also acts as a review of many of the notions presented so far, such as types, functions, and initialization, and provides an opportunity to explore our tool without adding new programming techniques or concepts. | Chapter 8 Technicalities: Functions, etc. Bjarne Stroustrup Abstract This lecture and the following present some technical details of the language to give a slightly broader view of C++’s basic facilities and to provide a more systematic view of those facilities. This also acts as a review of many of the notions presented so far, such as types, functions, and initialization, and provides an opportunity to explore our tool without adding new programming techniques or concepts. Stroustrup/Programming/2015 Overview Language Technicalities Declarations Definitions Headers and the preprocessor Scope Functions Declarations and definitions Arguments Call by value, reference, and const reference Namespaces “Using” declarations Stroustrup/Programming/2015 Language technicalities Are a necessary evil A programming language is a foreign language When learning a foreign language, you have to look at the grammar and vocabulary We will do this in this . | Chapter 8 Technicalities: Functions, etc. Bjarne Stroustrup Abstract This lecture and the following present some technical details of the language to give a slightly broader view of C++’s basic facilities and to provide a more systematic view of those facilities. This also acts as a review of many of the notions presented so far, such as types, functions, and initialization, and provides an opportunity to explore our tool without adding new programming techniques or concepts. Stroustrup/Programming/2015 Overview Language Technicalities Declarations Definitions Headers and the preprocessor Scope Functions Declarations and definitions Arguments Call by value, reference, and const reference Namespaces “Using” declarations Stroustrup/Programming/2015 Language technicalities Are a necessary evil A programming language is a foreign language When learning a foreign language, you have to look at the grammar and vocabulary We will do this in this chapter and the next Because: Programs must be precisely and completely specified A computer is a very stupid (though very fast) machine A computer can’t guess what you “really meant to say” (and shouldn’t try to) So we must know the rules Some of them (the C++14 standard is 1,358 pages) However, never forget that What we study is programming Our output is programs/systems A programming language is only a tool Stroustrup/Programming/2015 Technicalities Don’t spend your time on minor syntax and semantic issues. There is more than one way to say everything Just like in English Most design and programming concepts are universal, or at least very widely supported by popular programming languages So what you learn using C++ you can use with many other languages Language technicalities are specific to a given language But many of the technicalities from C++ presented here have obvious counterparts in C, Java, C#, etc. Stroustrup/Programming/2015 Declarations A declaration introduces a .
đang nạp các trang xem trước