4 ms·
Variadic templates are absolutely fantastic though as it allows you to have tuples<>, it allows you to have more type safety for printf() (An example can be fou
by X-Istence 14y ago
Variadic templates are absolutely fantastic though as it allows you to have tuples<>, it allows you to have more type safety for printf() (An example can be found on Wikipedia), and it allows all kinds of new and exciting code to be written that uses it for fantastic purposes. (I used it to write a filter interface that at compile time allows you to add multiple filters into a chain. The amount of filters is unlimited because of variadic templates).
I write C++ code for a living, I also write in Python for that same living, and I have to say that C++ allows me to write safe reliable code just as well as Python. There is definite code-reuse, readability and security.
As for a complex language ... what programming language isn't complex, while still having full power?
As for the "obtuse warning and error messages", those are being worked on. Those didn't get solved simply by switching to a different language, that is something every single programming language is still working on... I still get errors in Python every so often with a huge stack trace and still have issues trying to figure out why it failed! Using clang and newer versions of gcc you now get error messages that are easy to read, easy to understand and in most cases the compiler will even tell you what you got wrong and suggests possible fixes.
I too love C++, I love C++11 and what it brings to the table. I am currently still targeting an older versions of the STL, mainly due to the fact that on OS X most C++ code is compiled against libstdc++, especially third party code, which is incompatible with libc++ when it comes to string handling. BUT I do get to take advantage of the language features, auto, variadic templates, iterator based for loops that are created for me, and lambda's.
The other thing with the new STL is that it allows the developer to write less code, and let the STL take care of cleaning up after itself. It is more exception safe, with shared_ptr<> and friends, and provides a native way to do threading without requiring calls into platform dependant code (it is abstracted away), atomicity and other tools that will help make C++ on multi-threaded/multi-core systems to do more work in parallel!
C++ has come a long way, C++11 is absolutely fantastic and has only made C++ even better than it has been before. It is a shame that valid C++ 11 code will not compile on VS2012 as it will mean we still have to do various hacks to get the same features on the Microsoft Windows platform.
- pjmlp 14y agoIt will also fail to compile with the latest C++ compilers from IBM, HP and Oracle. I don't see anyone complaining about them. Or their lack of C99 and C11 support for that matter.
- fafner 14y ago> It will also fail to compile with the latest C++ compilers from IBM, HP and Oracle. I don't see anyone complaining about them. Because GCC is easily available on those systems. Well and the fact that those systems are far from being mainstream and come with a bunch of their own issues.
- pjmlp 14y agoIn the Fortune 500 world I work on, those systems are pretty mainstream. There are even AS/400 and VMS systems to play with.
- fafner 14y agoBut that world is too small and conservative in regard of language adoption.
- pjmlp 14y agoSure, but that is the world compiler vendors mostly listen to.
- fafner 14y agoHP, IBM, and Oracle? btw. the IBM XL C++'s support for C++11 seems to be as good as the one in VC++ 2012. They don't have lambdas but variadic templates instead.
- pjmlp 14y agoI mean most compiler vendors only care about big companies nowadays, since most startups don't want to pay for development tools. No standards driven language gets fully support at the same time across all vendors.
- eswangren 14y ago"As for a complex language ... what programming language isn't complex, while still having full power?" ...C. Of course some complexity is inherent to any programming language, but let's be real; C++ goes off the deep end in this department.