source code size metric: Python and modern C++

Brian Quinlan brian at sweetapp.com
Tue Dec 3 17:27:52 EST 2002


Duncan wrote:
> RPC systems have traditionally had interface definition languages,
> meaning a compiler writes the type safe proxy code for you. The code
> to acquire the object could be something like

If you have to write/use IDL code then you've already lost the coding
convenience war.

Newer distributed technologies (e.g. SOAP, REST) make validation
possible (for both the client and server) but don't require it. That
approach gives you the best of both worlds. 
 
>   CORBA::Object_var obj =
orb->string_to_object("corbaloc::myhost/adder");
>   Adder_var adder = Adder::_narrow(obj);

> More
> significantly for Python, we don't have to check that the add method
> really does return an integer (like we do with Python XML-RPC), since
> the RPC runtime does it for us.

And maybe that helps us and maybe not. In the add example that I gave,
the add function will happily add floats, strings, ints, lists, etc.
Types that cannot be added will generate an exception. As a Python
developer, this is exactly what I expect.

Also, it presumes that type checking is an important part of data
validation, which it might not be. It may be more important, for
example, to ensure that the arguments are < 100. 

Cheers,
Brian






More information about the Python-list mailing list