Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ C ++: Postmodern systems programming language     - JIRA 3.6.2 Upgrade from older version to the new version 6.0.8 (Linux)

- C language programming entry - macro definitions and enum (Programming)

- TOAST function in PostgreSQL (Database)

- How to configure MongoDB replica set (Database)

- Detailed Linux network security policies and protection measures (Linux)

- Linux Shell Scripting multithreading (Programming)

- Shell Programming points to note about the function (Programming)

- Talk about the Linux folder permissions issue again (Linux)

- impdp error ORA-39001, ORA-39000, ORA-31619 (Database)

- How to upgrade to Ubuntu 14.04 Ubuntu 14.10 (Linux)

- Java collections series (Programming)

- Fedora10 use Git version Configuration Management (Linux)

- Json data with double backslashes to a single backslash Json data processing (Programming)

- Ubuntu 15.04 / 14.04 install Ubuntu After Install 2.6 (Linux)

- [Errno 4] IOError: [Errno ftp error] with yum appears as a workaround (Linux)

- Android Studio installed in Ubuntu 15.04 (Linux)

- Learning how to teach safety system to prevent your own IP leakage (Linux)

- Figlet use (Linux)

- Python dictionary applications get built-in method (Programming)

- Apple Mac computer to install Windows 10 Concise Guide (Linux)

 
         
  C ++: Postmodern systems programming language
     
  Add Date : 2018-11-21      
         
         
         
  C ++ as a classic programming language since the eighties has been widely used in system development and high-performance computing. In recent years with the rise of a variety of programming languages ​​and paradigms, C ++ figure gradually fade out of view. But as a language continues to progress, C ++ rapid development in recent years, already has a modern language should have features, but also has many existing and ongoing new expansion.

The classic C ++

As a superset of the C language, on the one hand, C ++ integrates the advantages of C programming system, to precisely control the memory of each bit; on the other hand, provides a wealth of abstraction and programming paradigms, the introduction of object-oriented, pan type programming and functional programming style. Because of this, C ++ has a run-time performance comparable to C, on the other hand, also simplifies the C language difficult to bring the field of modeling. But because the overall design of C ++ combines a variety of styles, almost the equivalent of a huge system of nested several small language, which also makes C ++ overall ease of learning and ease of use on some bad. Meanwhile, the standard database updates to keep up with demand, such as software design Concurrency / Network and other aspects of the application layer is gradually replaced by newcomers such as Java. Furthermore, each C ++ compiler vendors to implement and not completely refer to ISO standards, but also caused a lot of cross-platform portability and compatibility issues.

Modern C ++

C ++ in recent years carried out several exploration and transformation, so that the language has become more modern features.

Resource Management

RAII (Resource Aquiration is Initialization, resource acquisition is initialization) as one of the features of C ++ is widely used in C ++ programs. RAII to control resources (including heap memory, file handles, network connections, etc.) through the heap object life cycle life cycle, so that resource management becomes more automated, but also to avoid the introduction of garbage collection caused when running burden. However, this model has a very important issue, that is, when the need to share resources, need to do more extra work to check and synchronize work.

As a more modern approach to resource management, C ++ 11 introduced two smart pointer, std :: shared_ptr and std :: unique_ptr. The former has a thread-safe reference counting, which is to control the life-cycle of resources through ownership (owenrship) transfer. C ++ 11 has also introduced rvalue references and move semantics process to avoid transfer of resources in unnecessary replication.

Similar in concept to Rust in the life cycle (Lifetime) and ownership (Ownership) of, C ++ std :: unique_ptr at the time of each transfer value will be transferred to the resource itself holds target of an assignment, combined with move semantics, the assignment further optimization of the process.

Lambda

Functor as an important component of C ++ STL, and it is in C ++ is to use a lot of features. A Functor is actually a overloaded operator () of the instance of an object class, such objects with C ++ template behavior can be seen as a simple function call, it is called Functor (functor). However, the C ++ classes and anonymous inner classes for support and not good enough to use Functor must be designed in advance. On the one hand is not convenient to use, on the other hand, the definition and use of the separation of the organization and understanding the code also caused some difficulties.

First, lambda as a substitute Functor, and can not solve the immediate problem of the definition and use. With STL containers and algorithms, lambda functions in C ++ can also style to the limit. Secondly, consistent performance for C ++ and abstract considerations, introduced the concept of lambda capture, making the lifetime of an object can be bound to a lambda expression, will be able to build objects closure (closure). In addition, C ++ 14 was added to the generic lambda, lambda enhanced type derivation algorithm, based on the type of security without compromising on features, so that modular programming (Combinator-based Programming) is easier to implement.

Complicating

In the early design of C ++, concurrent not as a core language features into account. And, threading concurrency model on a variety of different platforms have different implementations, to build a unified concurrency model is also very difficult.

C ++ 11 re-designed C ++ memory model, while maintaining compatibility with the original basis of the content of added concurrency. At the same time the standard library also joined thread (), semaphores (), mutex () and atomic operations () and so on. But also encapsulates the future / promise async mode and other operations on this basis.

Metaprogramming

C ++ itself for meta-programming provides a good support. One of the main components as a template, and provides a numerical calculation of compile-time type. However, on the one hand due to the use templates to slow down compilation speed, on the other hand, when using a stencil, very difficult to debug and troubleshooting, which makes a lot of people stay away, even STL template-based components there is also a sense of fear.

C ++ 11 in the meta-programming support do strengthened. The first is the type traits introduced as a standard library, it is possible to provide a template intuitive constraints, but also to the type of C ++ as a first class values ​​(first-class value) exists; the introduction of additional value calculation constexpr simplifies compile time , with the user-defined literals (user-defined literals) and a variable parameter templates (varadic template / parameter pack) and other features to C ++ to more easily define internal DSL.

Bright Future

As a classic programming language, C ++ are still constantly updated with. Upcoming C ++ 17, and is preparing for these important features:

Module TS: modular proposal for alternative language inherited from C header files to simplify C ++ compiler model and module dependencies,

Concepts TS: to enhance the type of constraint and type inference, while simplifying the usage of templates,

Reflection TS: support static compilation of reflections, simplify and enhance the type traits, provide a richer meta-programming features.

Conclusion

You can see the C ++ development has been walking in the forefront of the times online. On the one hand, an increase of more suitable for the development of components and systems, on the other hand, by extending the abstract language features to simplify complexity. As a newborn characteristics and historical responsibility of both programming language, enough to foresee the breadth of its application; similarly, more system-level open source projects like Mesos, also choose C ++ as the main programming language. There is sufficient reason to believe that, C ++ is being reborn.
     
         
         
         
  More:      
 
- 7 JavaScript interview questions (Programming)
- JavaScript property of checkbox.disabled (Programming)
- React Getting Started Tutorial (Linux)
- To install the latest version of Shotwell 0.18 under Ubuntu (Linux)
- Nginx Keepalived Nginx monitoring scripts (Server)
- Ubuntu installation module Python rq (Linux)
- Linux ./configure --prefix command (Linux)
- Python console achieve progress bar (Programming)
- SA weak password security system of the security risks posed (Linux)
- Open SSH remote access service that allows Android phone Ubuntu 14.04 (Linux)
- The several technical presentation Raid under Linux (Linux)
- Docker deployment practices in Ubuntu (Server)
- How to protect the Apache website under Linux system (Linux)
- Use XtraBackup to MySQL database online incremental backup and recovery (Database)
- 10 important Linux ps command combat (Linux)
- Create and modify Oracle temporary table space (Database)
- Security basics: simple analytical framework for Linux system firewall (Linux)
- Difference in MySQL VARCHAR and CHAR data format (Database)
- Installation and deployment of MariaDB under CentOS (Database)
- Android custom ViewPager create kaleidoscopic image transition effects (Programming)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.