wiki.hjertnes.website

Code Acccess Levels

Some programming languages have access keywords you can use to control how what are accessed. I've always had the impression that the main thing about them was security, but that isn't it. There are probably some cases where it is security aspects to it.

But the main thing is to control what part of your code is visibile to other parts of it. This is very important in general, but especially when you write packages.

Clean code and all of that comes it here.

But if you have clear abstractions with think interfaces to your code and the rest is not visible to others parts of your code base or other packages importing it then you don't have to think too much about breaking changes.

If all of your code is public, then everything importing your package will have access to it. And that means that you will be very limited in changes you can do without breaking other peoples code. If you instead only what is absolutley neccessary is exposed you have much more freedom with all the rest of the code