Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 938531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:39:35+00:00 2026-05-15T21:39:35+00:00

I was reading Google C++ Style Guide, and got confused in the Exceptions part.

  • 0

I was reading Google C++ Style Guide, and got confused in the Exceptions part. One of the cons of using it, according to the guide is:

Exception safety requires both RAII
and different coding practices. Lots
of supporting machinery is needed to
make writing correct exception-safe
code easy. Further, to avoid requiring
readers to understand the entire call
graph, exception-safe code must
isolate logic that writes to
persistent state into a “commit”
phase. This will have both benefits
and costs (perhaps where you’re forced
to obfuscate code to isolate the
commit). Allowing exceptions would
force us to always pay those costs
even when they’re not worth

Specifically, the statement that I didn’t understand is this:

(…) exception-safe code must isolate
logic that writes to persistent state
into a “commit” phase.

and this:

(…) perhaps where you’re forced to
obfuscate code to isolate the commit (…).

I think I’m not used to the terms “persistent state”, “commit phase”, “obfuscate code to isolate the commit”. It’d be nice some small explanations, examples or references about these terms and possibly why this is true.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:39:36+00:00Added an answer on May 15, 2026 at 9:39 pm

    “writes to persistent state” mean roughly “writes to a file” or “writes to a database“.

    “into a ‘commit’ phase.” means roughly “Doing all the writing at once”

    “perhaps where you’re forced to obfuscate code to isolate the commit” means roughly “This may make the code hard to read” (Slight misuse of the word “obfuscate” which means to deliberately make something hard to read, while here they mean inadvertantly make it hard to read, but that misuse may have been intentional, for dramatic effect)

    Elaborating more: “writes to persistent state” more closely means “Write out, to some permanent media, all the details about this object that would be needed to recreate it”. If writing was interrupted by an exception, then those “written out details” (i.e. “persistent state”) could contain half the new state and half the old state, leading to an invalid object when it was recreated. Hence writing the state must be done as one uninterruptable act.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was reading Google C++ Style Guide, and got confused in the Doing Work
I'm reading this google guide and using this sample code provided by google ,
Hey folks, thanks for reading I am currently attempting to do a Google-style calculator.
I remember reading a style guide explaining what the proper line-height should be for
I was reading in google's documentation their new pagespeed plugin, that they recommend using
I previously posted this question ( Reading Google docs spreadsheet ) and got a
So, I was reading the Google testing blog, and it says that global state
I am reading the tutorial at http://code.google.com/p/google-web-toolkit-incubator/wiki/LoginSecurityFAQ It states Remember - you must never
I've tried everything from reading the Netbeans help to browsing Google. This code works
I'm reading some data for countries around the world and am playing with Google's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.