If you are creating a library for other users, you want to open the API and hide everything else. You don't need undocumented "features" everywhere. This can lead to all kinds of errors, and they, in turn, can create security holes.
Even if the code is not for someone else, it's easy enough to forget and overturn yourself by assigning something from what you intended, or thinking that a variable means one when it means another.
So, the short answer is that itβs just a programming convenience, but these programming aids can help you create more reliable and secure code.
source share