News for hackers. Stuff that matters.
Re:We used C++20 to eliminate a class of runtime bugs by ncmncm on Friday January 14, 2022 @04:14PM (#29940538)
The code is ancient, and Google (like most) sees no value in modernizing old code, particularly for non-revenue-generating product. Furthermore, Google long ago locked themselves into an idiotically anti-RAII coding standard.

So, the example is of bad old code, at a place that enforces bad coding practice. The intent appears to be to suggest this is typical practice, which is not supported.

Re:We used C++20 to eliminate a class of runtime bugs by pjmlp on Saturday January 15, 2022 @02:41AM (#29944519)
Google seats at ISO C++, is a major contributor to clang and LLVM, and belongs to the group of companies with largest C++ code in production.

If this what a company with deep roots in C++ world is doing, what are the large majority of "dark matter" software factories doing, specially the sweetshop ones.

Re:We used C++20 to eliminate a class of runtime bugs by ncmncm on Saturday January 15, 2022 @06:48AM (#29945682)
A minuscule fraction of the people coding what they call C++ at Google come to the committee meetings. Google's ancient, idiotic prohibition on RAII is not a thing the current attendees, or other employees, have a say about. Many, attending or no, would rather be coding sensibly. And, in any case, the ancient code you present is not how code is being written even at Google today. So, your point is hopelessly muddled.

There are shops where people still write new C++ like it's 2011, or 2003, or 1998, or 1992, or C. There are plenty of shops where people code the best way their current production compiler allows. There are plenty where different people do some of each of those. Vanishingly few shops make an effort to rewrite ancient code according to current best practice.

I guess a sweetshop company is one with Oompa-loompas.

Re:We used C++20 to eliminate a class of runtime bugs by pjmlp on Saturday January 15, 2022 @04:00PM (#29950205)
One day I would appreciate to know where that perfect C++ world of yours exist in real world.

I guess I need to catch up with some Twilight Zone episodes.

Re:We used C++20 to eliminate a class of runtime bugs by ncmncm on Monday January 17, 2022 @12:03AM (#29963495)
Try "Willy Wonka and the Chocolate Factory"?