Reader Eric O was browsing the source of an API for handling concurrency when he stumbled on a telling mismatch between documentation and reality in a Status property.
The XML doc comment above the property explains earnestly that the status is private: the object itself needs to set it, but consumers should only be allowed to read it, lest everything break. The property declaration directly underneath, however, is public — complete with a public getter and a public setter that merely raises a PropertyChanged notification when the value differs from the backing field _status.
The article concedes that in practice this probably works fine, and the comment will at least appear in the generated documentation, gently hinting that the setter is off-limits. The punchline is the underlying assumption: that consumers of the API will actually read those docs — or care that a plainly public member merely claims to be private.
Comments
No comments yet — be the first.
Open the discussion
No account or password needed — just enter your e-mail and we’ll send you a one-time sign-in link. First time here? You’re set up automatically.
Your rating will be applied automatically after you sign in.
Check your inbox
We’ve sent a sign-in link to …. Open it on this device — this tab will sign you in automatically.
Nothing arrived? Check your spam folder — and mark the mail as "Not spam" so it lands in your inbox next time.