One class per file?

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Fri Oct 3 14:51:54 EDT 2008


greg a écrit :
> Bruno Desthuilliers wrote:
> 
>> OTHO, 'one class per file' is a standard idiom in Java and IIRC in C++ 
>> (which both have namespaces one way or another)
> 
> In Java you don't get a choice, because the compiler
> assumes a class can be found in the correspondingly
> named file.

For public classes only.

> 
> While C++ has namespaces, they don't have any defined
> relationship to source files, so they don't help you
> find which file something is defined in.

Nope. But IIRC, one-class-per-file helps saving on compile/link time. A 
problem we don't have with dynamic languages !-)




More information about the Python-list mailing list