A few weeks ago, I had an opportunity to share a few scenarios where C++ really matters to an internal audience from the field. No demo code or sample projects were reviewed, just the scenarios and first-hand examples.
Do you agree with these scenarios? Did I miss one? Do you have detailed examples for any of these that you would like to share (and get credit for if used in future presentations)?
Drop me a line (firstname.lastname@example.org) or comment below. Thanks!
Pure OOP enables better communicating system architecture, where as realistic implementation details effectively consume broader range of paradigms like closures rather than inner classes, currying( functional programming), games rules-engine & assertions (logic programming). Far back dynamic languages had platform-independent multi-paradigm support from PERL onwards. The low-level system support for C-style functional extended with OOP came only from C with classes. Even if new languages with more controlled feature-set targeting native development are born, C++ beginning with its C heritage has the more mature multi-paradigm facility for native development.
If I C++ a code library, build type static or dynamic, I am am tied to a particular compiler package, and a build type. Don't imagine passing around STL containers to a DLL (not with its own RTL; I would not consider using redistributables for any released code so if somehow DLL is using the same RTL and can do this, I won't). C is easy to get around this. No black boxes involved. There's a reason linux is C and no C++.
How long is this C++ parade to last? C-sharp/dotNet was 10 years. Talk about black box software. When it works, it works by some miracle but only if everything is just right and GC is neither too seldom nor too often, and no unforeseen errors occur, and when it doesn't work, well, keep patching until somehow it works most of the time.
WHat's next? Anything? Beyond C++.
C++ is widely used in Gaming too... Yet, C# defeated C++ when it comes to the development modules of console gaming stuffs (^_^)
C++ is still the king where you need both abstraction and performance. You can write code in it that is as high-level as anything you can write in more "modern" languages, but where C++ shines is that if you don't like the way something performs, you can pop the hood and tweak it yourself.
No abi? Unix platforms have a perfectly defined, effectively Standard abi that anyone can implement. You can mix units compiled by clang and gcc on osx all you want...for instance. Its windows where there is an abi problem because Microsoft holds at least one patent that stops compiler vendors from implementing their Abi on their own platform. Ms also does not document their abi very well. Don't blame that problem on c++. If you want to see interesting discussion of the subject, go through the clang developer list where people working to complete clang on windows discuss their issues. Btw. I have spent time working in the Linux kernel over the last few weeks. I'm glad it's not my job to maintain all the primitive code I see there. I particularly love the 'goto' expressions.
C++: Speed, size, control and determinism. Everyone forgets the last.
Same or better high level abstraction, with far better performance.
MFC is quite possibly the most terrible and inconsitent GUI library ever to come into existence. I would not use it as an argument for learning C++, but against it (since knowing C++ increases your chance of having to work with that monster of a library).
All valid & good points.
We want a modern & well supported version of the MFC.
C++ support for compile-time metaprogramming via templates is beyond anything available in most other languages. With templates, you write code that writes the code that is compiled. :)
@Tamás Szelei: What rubbish. MFC was excellent when it first came out; as was WinForms; both technologies have been made redundant by later advances; but that doesn't mean they were badly written in the first place.
Meanwhile, offline documentation for Win32 Desktop development under VS2013 is still broken beyond repair.
As i knows, C++ is a father of all language .. so we can say .. it's a father ..