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++?
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.
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.
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.
Extensive use of standard library and STL, exceptions and templates - rather than just C with classes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With