Top "Namespaces" questions

A namespace is a container that provides context for identifiers, within which names are unique.

What does if __name__ == "__main__": do?

Given the following code, what does the if __name__ == "__main__": do? # Threading example import time, thread def myfunction(string, sleeptime, …

python namespaces main python-module idioms
Why is "using namespace std;" considered bad practice?

I've been told by others that writing using namespace std; in code is wrong, and that I should use std::…

c++ namespaces std using-directives c++-faq
How do I declare a namespace in JavaScript?

How do I create a namespace in JavaScript so that my objects and functions aren't overwritten by other same-named objects …

javascript namespaces javascript-namespaces
"Can't find Project or Library" for standard VBA functions

So I'm having to run someone else's excel app on my PC, and I'm getting "Can't find Project or Library" …

excel vba reference namespaces
How to properly overload the << operator for an ostream?

I am writing a small matrix library in C++ for matrix operations. However my compiler complains, where before it did …

c++ namespaces operator-overloading iostream ostream
How to add reference to System.Web.Optimization for MVC-3-converted-to-4 app

I'm trying to use the new bundling feature in a project I recently converted from MVC 3 to MVC 4 beta. It …

asp.net-mvc-4 namespaces asp.net-optimization
printf with std::string?

My understanding is that string is a member of the std namespace, so why does the following occur? #include <…

c++ string namespaces printf std
Getting "type or namespace name could not be found" but everything seems ok?

I'm getting a: type or namespace name could not be found error for a C# WPF app in VS2010. This …

c# visual-studio reference namespaces directive
Can someone explain __all__ in Python?

I have been using Python more and more, and I keep seeing the variable __all__ set in different __init__.py …

python syntax namespaces
error C2065: 'cout' : undeclared identifier

I am working on the 'driver' part of my programing assignment and i keep getting this absurd error: error C2065: …

c++ namespaces visual-studio-2010 std