What are they for and how do we make it? Can you give me an example?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To avoid collisions with multiple libraries, for example.
Say they both use a variable commonly used such as
data. If both libraries use private variables it’s all fine:However suppose they don’t use private variables but global ones like this:
So
lib1.get()will fetch the same data aslib2.get().This example is too obvious of course but to stay safe it’s a good practice to use private variables.