On Sun, Feb 12, 2012 at 9:28 PM, Gary Wright <at2002+...@me.com> wrote:
> ruby client code => ruby binding => libzmq C binding => C++ core
>
> So I would just apply the principle described above to each interface.
>
> The C++ code should use error codes/exceptions according to C++ idioms.
> The libzmq C interface should translate C++ exceptions into error codes.
> A Ruby binding, for example, should translate some errors back into 
> exceptions.

Hello,

I don't necessarily agree that the library code should take care of
validating every argument passed to it. In your example the ruby
binding should take care of the sanity of the arguments passed to
lower level or the ruby binding can be built on top of czmq, which
does more validation.
Adding more validation and cruft on the critical path means additional
CPU cycles wasted, which is not desirable in all cases. In my opinion
the raw library can and should assume that sane arguments are being
passed in and the higher level interfaces (czmq for example) can and
should do the validation on top of it if necessary.

-- Mikko
_______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to