Why do we study classes and objects?

Pages: 123
If you would only distribute it as compiled binaty it is impossible and is viable if you have shortage of time (just make sure that this won't happen: http://www.viva64.com/en/a/0083/)

However a huge layer of program products is libraries which have at least part of code exposed to user. If you will want to update/fix your library you should be very careful to not break existing code built on top of library. And if there is customer code which depends on exposed internals (and there will be one), you cannot change that code.
Also do not forget that your application might accept exceptions or plugins. Bad encapsulation can give you problems there too.

Imagine if you will expose Weapon class so people can decorate with additional functions in addons. Someone might start manipulating damage directly instead of relying on member functions to do so. And if you decide to change how damage is calculated, launching game with this addon can break your game.
Topic archived. No new replies allowed.
Pages: 123