Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is modern C++? [closed]

Tags:

c++

I sometimes read discussion on why C++ is good or bad and sometimes one of the arguments cites that today's modern C++ is very different from the old C++. I am wondering exactly what the difference would be? What would be an example of 'modern' C++ and what would be an example (preferably doing the same thing) of this 'old' C++?

like image 311
KnowsLittle Avatar asked Sep 07 '10 17:09

KnowsLittle


People also ask

What is modern C language?

Modern C introduces you to modern day C programming, emphasizing the unique and new features of this powerful language. For new C coders, it starts with fundamentals like structure, grammar, compilation, and execution.

What is meant by modern C++?

Modern C++ emphasizes the principle of resource acquisition is initialization (RAII). The idea is simple. Resources (heap memory, file handles, sockets, and so on) should be owned by an object. That object creates, or receives, the newly allocated resource in its constructor, and deletes it in its destructor.

How is modern C++ different?

In modern C++, an object is created on the stack whenever possible, or at least wrapped within some sort of a smart pointer. Another difference is that old style C++ focuses more on OOP, while modern C++ uses a mix of programming styles: procedural, modular, object, and generic.


1 Answers

Extensive use of standard library and STL, exceptions and templates - rather than just C with classes

like image 122
Martin Beckett Avatar answered Oct 22 '22 18:10

Martin Beckett