3 ms·
Nothing against personal preferences, but one side-effect of overwhelming complexity is that only very few people can be trusted to write safe C++. The better y
by fauigerzigerk 10y ago
Nothing against personal preferences, but one side-effect of overwhelming complexity is that only very few people can be trusted to write safe C++. The better you know C++ the more suspicious you become of C++ code written by others. At least that is my personal experience.
And I think that's a major reason why C++ usage is gradually becoming a niche thing used only where absolutely necessary. As evidence for that claim I submit this chart (you need to scroll down a page): https://www.itjobswatch.co.uk/jobs/uk/c++.do https://www.itjobswatch.co.uk/jobs/uk/c++.do
C++ used to be required for over 30% of all permanent programming jobs in the UK back in 2005. Now it's down to 8.5% and falling. That's in stark contrast with all the enthusiasm created by the features added since C++11, features that I very much welcome.
- sun_n_surf 10y agoThis is not as bad as it sounds. You need to consider the absolute numbers than the relative percentages for languages like C++. Programming is more accessible than ever before, more jobs require some element of programming than ever before, and more things are getting created using code. This means that people who have never written code before are writing code as a job of work, and are writing it in simpler-to-learn languages. Newer, simpler programming jobs are acquiring programmers in other languages, not necessarily that C++'s complexity is driving people away from it into the arms of other languages or that C++ is not acquiring newer programmers at the same rates (on existing base) as before.
- fauigerzigerk 10y ago>This means that people who have never written code before are writing code as a job of work, and are writing it in simpler-to-learn languages. It would be interesting to know if the share of developers with formal training has risen or fallen in the past 12 years. I would have guessed it has risen in spite of a large number of JavaScript wielding web designers. There used to be quite a lot of DIY programming using VB6, VBA, Excel, MS-Access, dBASE, FoxPro, etc, at a time when professional IT departments and cloud services were not as widespread as they are today. In my opinion these technologies were a lot more accessible than the current web platform.
- overgard 10y agoC++ has been getting a lot safer though. Modern C++ generally has you using shared_ptr and unique_ptr and references, which cut down on a lot of common pointer mistakes. There's also a lot of const mixed in, which I think helps. Debuggers have also gotten a lot more reliable (I remember one crash bug that I couldn't find after like three days of looking in an old visual studio version, whereas newer visual studio caught it immediately). Not that the language isn't a minefield, but if you walk in the modern part there's a lot less mines buried in the ground. As much as I complain about C++, I just don't think there's a viable alternative, and I somewhat reject the notion that writing performant code is a niche thing. Like, sure, there are common contexts where you can get away with wasting CPU, but IMO part of being a skilled professional programmer is getting the most out of the machine, and you just can't do that with most other languages.
- pjmlp 10y ago> I somewhat reject the notion that writing performant code is a niche thing. It surely isn't, otherwise we wouldn't be getting wind back into going native sails, with Swift, Rust, Go, Crystal, D, .NET Native, CoreRT, Java 9 (just a little bit, more with 10)....
- duneroadrunner 10y ago> I just don't think there's a viable alternative Fyi, when safety is important and C++ is the only viable alternative, there's SaferCPlusPlus[1]. And wrt new C++17 features, I'll just point out that the SaferCPlusPlus library provides a version of std::any (and std::variant) geared specifically for pointer/iterators. That is, you can, for example, dereference the contained pointer/iterator without needing to know its actual type. And for those that need it, it also provides the "recursive_shared_timed_mutex" that's notably missing from the standard library. [1] shameless plug: https://github.com/duneroadrunner/SaferCPlusPlus https://github.com/duneroadrunner/SaferCPlusPlus
- progman 10y ago> I just don't think there's a viable alternative If C++ is your only hammer then every problem looks like a nail to you. Of course, there are viable alternatives. At least Ada which is still used in avionics and other safety critical systems.