A brief description
Preface
Computers are some of the most versatile tools that we have available. They are capable of performing stunning feats of computation, they allow information to be exchanged easily regardless of location, they simplify many every-day tasks, and they allow us
to automate many processes that would be tedious or boring to perform otherwise. However, computers are not "intelligent" as we are. They have to be told in no uncertain terms exactly what they're supposed to do, and their native languages are quite unlike
anything we speak. Thus, there's a formidable language barrier between a person who wishes a computer to do something, and the computer that does not know what it's supposed to do. So far, computers cannot figure out what they are supposed to do on their own,
and thus they rely on
programs which we create, which are sets of instructions that the computer can understand and follow.
An Overview of Programs and Programming Languages
In order to better communicate to our computers what exactly it is we want them to do, we've developed a wide range of
programming languages to make the communication process easier.
Depending on the type of project, there are many factors that have to be considered when choosing a language. Here is a list of some of the more noteworthy ones:
-
Compiled, interpreted, or JIT-compiled
Compiled languages are translated to the target machine's native language by a program called a compiler. This can result in very fast code, especially if the compiler is effective at optimizing, however the resulting code may not port well
across operating systems and the compilation process may take a while.
Interpreted languages are read by a program called an interpreter and are executed by that program. While they are as portable as their interpreter and have no long compile times, interpreted languages are usually
much slower than an equivalent compiled program.
Finally, just-in-time compiled (or JIT-compiled) languages are languages that are quickly compiled when programs written in them need to be run (usually with very little optimization), offering a balance between performance and portability.
-
High or low level
A low-level language deals more with direct hardware interaction, and thus is more suitable for programs like device drivers code that really needs access to the hardware. Since a low-level language is subject to all the nuances of the hardware
it's accessing, however, a program written in a low-level language is generally difficult to port to other platforms. These languages are almost always compiled.
A high-level language focuses more on concepts that are easy to understand by the human mind, such as objects or mathematical functions. A high-level language usually is easier to understand than a low-level language, and it usually takes less
time to develop a program in a high-level language than it does in a low-level language. As a trade-off one generally needs to sacrifice some degree of control over what the resulting program actually does. It is not, however, impossible to mix high- and low-level
functionality in a language.
-
Type system
A type system refers to the rules that the different types of variables of a language have to follow. Some languages (including most assembly languages) do not have types and thus this section does not apply to them. However, as most languages
(including C++) have types, this information is important.
-
Type Strength: Strong or Weak
A strong typing system puts restrictions on how different types of variables can be converted to each other without any converting statements. An ideal strong typing system would forbid implicit "casts" to types that do not make any sense, such as an integer
to a Fruit object. A weak typing system would try to find some way to make the cast work.
-
Type Expression: Manifest or Inferred
This deals with how the compiler/interpreter for a language infers the types of variables. Many languages require variables' types to be explicitly defined, and thus rely on manifest typing. Some however, will infer the type of the variable based on the contexts
in which it is used, and thus use inferred typing.
-
Type Checking: Static or Dynamic
If a language is statically typed, then the compiler/interpreter does the type checking once before the program runs/is compiled. If the language is dynamically type checked, then the types are checked at run-time.
-
Type Safety: Safe or Unsafe
These refer to the degree to which a language will prohibit operations on typed variables that might lead to undefined behavior or errors. A safe language will do more to ensure that such operations or conversions do not occur, while an unsafe language will
give more responsibility to the user in this regard.
These typing characteristics are not necessarily mutually exclusive, and some languages mix them.
-
Supported paradigms
A programming paradigm is a methodology or way of programming that a programming language supports. Here is a summary of a few common paradigms:
-
Declarative
A declarative language will focus more on specifying what a language is supposed to accomplish rather than by what means it is supposed to accomplish it. Such a paradigm might be used to avoid undesired side-effects resulting from having to write one's own
code.
-
Functional
Functional programming is a subset of declarative programming that tries to express problems in terms of mathematical equations and functions. It goes out of its way to avoid the concepts of states and mutable variables which are common in imperative languages.
-
Generic
Generic programming focuses on writing skeleton algorithms in terms of types that will be specified when the algorithm is actually used, thus allowing some leniency to programmers who wish to avoid strict strong typing rules. It can be a very powerful paradigm
if well-implemented.
-
Imperative
Imperative languages allow programmers to give the computer ordered lists of instructions without necessarily having to explicitly state the task. It can be thought of being the opposite of declarative programming.
-
Structured
Structured programming languages aim to provide some form of noteworthy structure to a language, such as intuitive control over the order in which statements are executed. Such languages generally deprecate "jumps", such as those provided by the goto statement
in C and C++.
-
Procedural
Although it is sometimes used as a synonym for imperative programming, a procedural programming language can also refer to an imperative structured programming language which supports the concept of procedures or subroutines.
-
Object-Oriented
Object-Oriented programming (sometimes abbreviated to OOP) is a subset of structured programming which expresses programs in the terms of "objects". Such a paradigm allows code to be reused in remarkable ways and is meant to be easy to understand.
-
Standardization
Does a language have a formal standard? This can be very important to ensure that programs written to working with one compiler/interpreter will work with another. Some languages are standardized by the American National Standards Institute (ANSI), some are
standardized by the International Organization for Standardization (ISO), and some have an informal but de-facto standard not maintained by any standards organization.
The Features of C++ as a Language
Now that all the necessary theory has been covered, now it is possible to explain what C++ has to offer as a programming language. C++...
-
...is an open ISO-standardized language.
For a time, C++ had no official standard and was maintained by a de-facto standard, however since 1998, C++ is standardized by a committee of the ISO. Their page may be accessed
here.
-
...is a compiled language.
C++ compiles directly to a machine's native code, allowing it to be one of the fastest languages in the world, if optimized.
-
...is a strongly-typed unsafe language.
C++ is a language that expects the programmer to know what he or she is doing, but allows for incredible amounts of control as a result.
-
...supports both manifest and inferred typing.
As of the latest C++ standard, C++ supports both manifest and inferred typing, allowing flexibility and a means of avoiding verbosity where desired.
-
...supports both static and dynamic type checking.
C++ allows type conversions to be checked either at compile-time or at run-time, again offering another degree of flexibility. Most C++ type checking is, however, static.
-
...offers many paradigm choices.
C++ offers remarkable support for procedural, generic, and object-oriented programming paradigms, with many other paradigms being possible as well.
-
...is portable.
As one of the most frequently used languages in the world and as an open language, C++ has a wide range of
compilers that run on many different platforms that support it. Code that exclusively uses C++'s standard library will run on many platforms with few to no changes..
-
...is upwards compatible with C
C++, being a language that directly builds off C, is compatible with almost all C code. C++ can use C libraries with few to no modifications of the C library code.
-
...has incredible library support.
A search for "library" on the popular project-management website
SourceForge will yield over 3000 results for C++ libraries. A link to the results of the search may be found
here.
分享到:
相关推荐
C++ can be displayed by pressing Alt-H/A. c. Computer brand, model, and the brands and model numbers of any additional hardware. d. Operating system and version number. (The version number can ...
Standard Template Library STL Basics Class List-A Set of Students Creating a Waiting List with the STL List Storing Grades in a STL Map Putting It All Together Practical Considerations When Using the...
CPASDEMO PAS - Pascal program that demonstrates Turbo Pascal - Turbo C++ interface CTOPAS CFG - Config file for Pascal - Turbo C++ interface demo CTOPAS PRJ - Project file for Turbo Pascal - Turbo...
A brief description ), Sourcecode( 这个太多了,不一一列出, C++ Tutorial Sources(这是本很不错的官方c++ tutorial pdf), ), Articles( Distinguish between pointers and references in C++, Comparison of ...
C++ can be displayed by pressing Alt-H/A. c. Computer brand, model, and the brands and model numbers of any additional hardware. d. Operating system and version number. (The version number can ...
Also includes a brief introduction to programming for multicore processors in native C++ and C++/CLR processors Nearly 100,000 copies of this book have been sold in previous editions Beginners ...
- **File Comments:** Include a brief description of the file’s purpose at the top. - **Class Comments:** Provide documentation for each class. - **Function Comments:** Describe what the function does...
Brief: Bidirectional conversion between C/C++ types (native, STL, openCV...) and Matlab matrix (compile or run time). Key words: C, C++, mxArray, OpenCV, IplImage, iterator, mex, engine Description:...
Gmsh is a three-dimensional finite element mesh generator with a build-in CAD engine and post-processor. Its design goal is to provide a ... A brief description of the four modules is given hereafter.
Alternatively, the following links will let you browse code files by name (and brief description), by routine identifier, or by section number in the book. If you are a subscriber to Numerical ...
对于函数,还可以使用`///`或`/**<brief description> ... */`提供简短说明。 一旦配置文件设置完毕,运行Doxygen命令即可生成文档。在命令行中,输入`doxygen Doxyfile`(或配置文件的实际路径)启动文档生成过程...
* @brief <Brief description of the file> * * $Author$ * $Date$ * $Revision$ */ /*************************************************************************** */ ``` 具体的格式应以项目提供的文件头部脚本...
@brief Brief description. */ - `/** Brief description. * Detailed description starts here. */` - `/** Brief description. * . Detailed description starts here. */` **应用场合** 1. **文件头**:声明...
* @brief A brief description of the class * * Detailed description of MyClass. */ ``` 2. 函数和方法:`@param`用于描述参数,`@return`描述返回值,`@throw`描述可能抛出的异常。 ```cpp /** * @brief ...
Each issue will have a description, location, and a message ID that corresponds to the specific rule violated. To address the issues, review the code at the indicated locations and modify it ...
* @brief This is a brief description of the function. * @param[in] param1 Description of parameter 1. * @param[out] param2 Description of parameter 2. * @return Description of return value. */ ...
- 关键点检测器,如SIFT(尺度不变特征变换)、SURF(加速鲁棒特征)、ORB(Oriented FAST and Rotated BRIEF)等 - 特征描述子的提取和匹配 - 使用特征进行图像配准、拼接等高级操作 6. Video Analysis 视频分析...
* \brief This is a brief description. * * This is a more detailed description. * * \author John Doe * \date 2023-04-01 */ ``` #### 列表 Doxygen 支持创建有序和无序列表。 ##### 无序列表 - 使用 ...