Thursday, November 28, 2013

Scopes and Namespaces

Scopes and Namespaces

This week, Professor Danny introduced scopes and namespaces. During my programming, I would often run into problems where the interpreter cannot locate the "global" name of a variable, or the name of a variable was a local variable and therefore useless outside the scope of the method. "Global", "local", and "nonlocal" namespaces for the names of variables were new concepts I had never really touched upon before. With these namespaces, the scope for the usability of the names could be easily changed. If I ever had to use a variable outside of its method, the "global" namespace would certainly be useful. Namespaces certainly proved to be extremely useful programming tools.

No comments:

Post a Comment