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 6081089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:08:11+00:00 2026-05-23T11:08:11+00:00

I came across this line in Effective C++ : Public means unencapsulated, and practically

  • 0

I came across this line in Effective C++:

Public means unencapsulated, and practically speaking, unencapsulated means unchangeable, especially
for classes that are widely used.Yet widely used classes are most in need of encapsulation, because
they are the ones that can most benefit from the ability to replace one implementation with a better
one

What does the author mean by “Public means unencapsulated, and practically speaking, unencapsulated means unchangeable”?

And how is unencapsulated unchangeable?

  • 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-23T11:08:11+00:00Added an answer on May 23, 2026 at 11:08 am

    The general idea is simple. If you make something public, then someone can and probably will use it. Therefore, if you change something that is public, all of the code that uses it immediately breaks. Breaking people’s code is bad; it tends to lead to them not wanting to use your code anymore, since now you’ve forced them to rewrite all of their stuff just because you wanted to use a different type or something.

    The public interface is a contract between the implementation of the class and the user of it. Changing that contract, particularly without advanced notice, is considered very rude.

    If all of your code is internal, that’s fine. But if it’s not, if you’re making a library for others to use (whether locally or just selling a library), then people are less likely to be happy about interface changes.

    It isn’t a matter of rules of C++; it’s simply a matter of rules of interface design. Since public things are part of the interface, you must be careful about what you make public.

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

Sidebar

Related Questions

I came across this line in a MySQL script `other_validator` varchar(5000) NOT NULL DEFAULT
I came across this line in a book on WCF: ...and the languages used
I recently came across this line in a PHP script: $_REQUEST['start_date']=$date; Is it allowed
I was analyzing Javascript codes and came across this line: var date = (new
I am learning JSF and came across this line: <h:messages layout=table></h:messages> in a sample
I came across this line of code in an application I am revising: substr($sometext1
While reading some Java source, I came across this line: ((Closeable) some_obj).close(); some_obj is
I came across this line: void (*(*x)(void (*[10])(int *)))(int *) Can anybody tell me
I was looking at some code and I came across this line: Machine drink[]
I just came across this line of code: SDL_Color textColor = { 255, 0,

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.