From: Martin Elzen Date: 2004-05-13T21:27:04+09:00 Subject: C++ namespaces in Ruby Recently someone pointed out that in his opinion there was just one thing Ruby was missing, which was something like C++ namespaces. Someone else replied that in that case the OP should use Ruby modules. That's not exactly true, IMO. In C++ the most significant difference between namespaces and classes is that namespaces are open, and classes are shut. Meaning that you can always add things to an already defined namespace, but you can not add anything to an existing class (unless you happen to have the source code of that class). In contrast, Ruby classes are always open, you can always add things to them, etc. , so in that way Ruby classes are like C++ namespaces. IMO if you want to achieve C++-like namespaces in Ruby, you'd be best off by using a Ruby class. A Ruby class also comes closer to a C++ namespace than a Ruby module because a Ruby class can contain instances of objects, and as far as I know this isn't possible in a Ruby module. Sincerely, Martin