Alexito's World

A world of coding 💻, by Alejandro Martinez

Why internal and no protected?

This is a question that I have in my mind since Apple introduced the access modifiers. Why we want internal and not protected?

The thing is that when I'm creating or designing software sometimes I found myself with the need to overwrite things in a subclass without exposing those properties or methods in the public interface.

In the other hand I don't think that I really need to give acces to another classes of my framework but not to the public interface, this seems weird for me.

I'm also in favour of having only public and private, but if I need another modifier I would like to see something like protected, not like internal.

If you liked this article please consider supporting me