5 ms·
Does anyone have an example of a large codebase that actually uses modern C++ to its fullest? One of the larges codebases I know about, Chromium, seems to use
by atombender 6y ago
Does anyone have an example of a large codebase that actually uses modern C++ to its fullest?
One of the larges codebases I know about, Chromium, seems to use only a minimum of C++ features. It's mostly limited to 1980s "C with objects" paradigm, plus smart pointers.
- rumanator 6y ago> Does anyone have an example of a large codebase that actually uses modern C++ to its fullest? The point of a language is not to use all the bells and whistles just for the sake of playing language feature bingo. The point of a language is to offer developers the tools they need to use to achieve their goals. Some C++ standards offer stuff that are must-haves, nice-to-haves, and meh. Just because you want to use std::make_unique that doesn't mean you should rewrite your code to get all your lambdas to do return type deduction.
- atombender 6y agoSorry, that's not an answer. I'm asking whether there are any projects that use modern C++ to its fullest. By fullest I don't mean using features for features' sake; that's a ungenerous reading of my comment.
- rumanator 6y ago> Sorry, that's not an answer. I'm asking whether there are any projects that use modern C++ to its fullest. That's precisely the answer, because the question, as you framed it, is absurd. The point of using a language is to benefit from the features it provides. It makes absolutely no sense to argue that a language is not used "to its fullest" if you don't play feature bingo in your projects. That's silly. I'm using C++14 to its fullest if I use std::make_unique even if I use no template metaprogramming or lambdas or even throw exceptions. It makes no sense to argue otherwise.
- atombender 6y agoThat's still a non-sequitur. As an counter-example, it's possible to write conformant C++ without using any features that aren't also in C: I am, objectively, not using C++ to the fullest if I'm restricting myself to functions instead of methods, char pointers instead of std::string, statically allocated arrays or pointers instead of vectors, and so on, thereby ignoring 90% of the spec. If I'm not using constexpr, for example, then I'm using one of less feature provided by the language. Constexpr, like all other modern C++ features not present in "old" C++, was invented to serve a purpose, and without it, you have to reach for more blunt, possibly more verbose and less expressive tools. In other words, many new features (such as ranges) increase expressiveness in a quantifiable manner. I may not need, for the specific program that I'm writing, the full range of features, and may not need constexpr. But that wasn't the question. Again, I'm not asking about egregious use of features of features' sake. I'm asking about examples of projects that use in a positive and not superfluous terms modern features of C++. It's not an absurd question, and your response is just obtuse (and unhelpful!).
- pjmlp 6y agoC++/WinRT for UWP makes use of advanced C++17, not sure if that is using C++ at its fullest whatever that means. Same thing applies to SYCL, CUDA and Metal Shaders (MSL uses C++14 though).
- lorenzhs 6y agoIt's not as large as Chromium by far (~55k lines + ~27k lines support library), but I quite like the Thrill codebase. It's a research prototype (but not what you would typically associate with "research code") of a big data platform like Spark but in C++. It makes nice use of lambdas with return type deduction, some template metaprogramming in the internals, smart pointers & RAII, and generally uses lots of modern C++ features. https://project-thrill.org/ https://project-thrill.org/ and https://github.com/thrill/thrill https://github.com/thrill/thrill (disclosure: I know the authors and have worked on/with it for a bit).
- atombender 6y agoPerfect, thanks! Looks like an interesting project. I've bemoaned the dominance of Java in the distributed data processing world for a long time, and I didn't know about Thrill.