Giter Club home page Giter Club logo

Comments (4)

guodongxiaren avatar guodongxiaren commented on September 2, 2024

1. C++是什么?

C++是一个多功能的编程语言,并且偏向于系统编程,它:

  • 比C语言更好
  • 支持数据抽象(例如:类class)
  • 支持面向对象编程(例如:继承)
  • 支持泛型编程(例如:可复用的泛型容器和算法)
  • 支持函数式编程(例如:模板元编程、lambda函数、constexpr

C++被ISO标准委员会稳定支持了几十年,并且还拥有一个庞大且活跃的用户社区。您可以阅读《The C++ Programming Language》《Evolving a language in and for the real world: C++ 1991-2006》了解更多。

from blog.

guodongxiaren avatar guodongxiaren commented on September 2, 2024

2. C++是一门实用的语言吗?

是的。

C++是一个实用的工具,尽管它不完美,但是它有用。

在工业软件的世界里,C++被视作是一个成熟、稳固且主流的工具。它拥有广泛的工业界的支持,使得它从全面的商业出发变得越来越好。

from blog.

guodongxiaren avatar guodongxiaren commented on September 2, 2024

3. C++是一门完美的语言吗?

不是。

C++被设计出来的目的不是用以表现一个完美的编程语言应有的样子。设计它的目的是作为一个接机实际问题的工具。

作为实用型编程工具,它有一些瑕疵。但是继续去打磨语言去达到学术界纯粹的完美,这不是C++的目标!

from blog.

guodongxiaren avatar guodongxiaren commented on September 2, 2024

4. 什么是零开销(zero-overhea)原则?

零开销(zero-overhea)原则是**设计C++**的指导方针。它是说:凡是你不使用的,你不要为之付出(时间或空间)。引申出来是:你所能使用的,都是最好的(你不可能自己写的更好)。

换句话说:如果一个新特性会使得C++任何已存在的代码变得更大或者更慢,那么这个新特性就不应该被加入标准;如果新特性使得编译器生成的代码还不如程序员在不使用这个特性时手写的代码,那么这个新特性也不应该被加入标准!

译者注:

这个其实是C++标准持续演化的原则,要动态看待。大概就是说C++不停修订增加新特性,到低要选择哪些进入标准之中。满足零开销是准入门槛!

from blog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.