Emulating C++ coding style

Alan Gauld alan.gauld at gssec.bt.co.uk
Fri Apr 23 08:28:12 EDT 1999


> >2. stream class
> >  e.g. cout << "hello python."<<endl;
> 
> VERY bad idea.  Bad even in C++.

Why?
Its one of the 'improvements' over C that allows 
overridding of the << operator so that you can 
write a class to any stream. Python does similar 
with the _str_ mechanism but that doesn't allow 
chaining of types together, which I do like in C++

so why is it a bad idea?

Since its off-topic for the group respond by email 
if you want...

> In proper C++, your const will be contained inside a class (probably
> static) to keep it out of the global namespace.  

Hopefully not. It should be contained within a C++ namespace.

Alan G.

-- 
=================================================
This post represents the views of the author 
and does not necessarily accurately represent 
the views of BT.




More information about the Python-list mailing list