Reply to post: Re: Googley

Google says Android runs better when covered in Rust

Dan 55 Silver badge

Re: Googley

I looked for "constructor", "destructor", and "initialize" and found a long list of caveats which could prevent RAII being used in many cases.

I'm also surprised that RAII is not mentioned in Google's style guide apart from in passing when saying that exceptions shouldn't be used. Exceptions and RAII used together are a valid way of avoiding memory vulnerabilities in C++.

Also Google mentioned that they decided not to allow exceptions because their existing code did not deal with exceptions. If they are banning one C++ feature and not encouraging another to avoid changing legacy C code and those two features avoid memory vulnerabilities, you simply cannot conclude that the problem is down to C++ and it must be thrown out and replaced with Rust. They never threw out C and replaced it with C++ in the first place.

The right way to do it was updating the C code instead of not using C++ features because they didn't work with existing C software and they paid the price for not doing that. Now they've decided to throw out C++ but they still haven't worked out that they're doing that precisely because of their coding guide.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon