Point of private/public variables/methods

What is the point in encapsulating methods/variables? I know that it may make your code more organised but is there much more benefits such as security, efficiency or performance, thanks?

The generic software engineering principle is information hiding:

http://en.wikipedia.org/wiki/Information_hiding

The basic idea is to separate what something (e.g. a class) does from how it does it. All the built-in Xojo classes you use, you just get to use the public methods and properties. They all have an implementation behind them, with private methods and properties, that is opaque to you and mostly unimportant so far as you’re concerned. You can turn around and design classes similarly for your own or others’ consumption.

[quote=44141:@Brad Hutchings]The generic software engineering principle is information hiding:

http://en.wikipedia.org/wiki/Information_hiding

The basic idea is to separate what something (e.g. a class) does from how it does it. All the built-in Xojo classes you use, you just get to use the public methods and properties. They all have an implementation behind them, with private methods and properties, that is opaque to you and mostly unimportant so far as you’re concerned. You can turn around and design classes similarly for your own or others’ consumption.[/quote]
This is actually pretty important as far as I am concerned. Do not want sound rude saying that btw.

I am going to program an app building engine.

Cheers.