[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-dbus
Subject:    Re: using dbus in the platform
From:       Thiago Macieira <thiago () kde ! org>
Date:       2007-10-09 18:06:02
Message-ID: 200710092006.02843.thiago () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


Em Tuesday 09 October 2007 19:14:48 Olivier Galibert escreveu:
> Except that this convention[1] is crap when you need to use the
> library to write bindings for another language, especially an
> interpreted one.  You kill any hope of having a good interaction with
> a native-language debugger.  "Sorry, the application died in a native
> call, we can not give you a backtrace or variables state".

I don't agree.

If the API contract says "you shall not pass an invalid path", then you 
shouldn't do it! The missing caveat here is that it's not easy to check for 
an invalid path, unlike the check for != NULL.

If there were a function to do the check -- and I really think there should be 
one, since I implemented my own and Simon implemented another just to comply 
with this requirement -- then the binding function would simply check its 
arguments at the beginning of the function and throw an exception if they're 
invalid.

This would avoid a lot of repeated and unnecessary checks. Imagine if the path 
were used sequentially in several calls... why check it at every single 
libdbus entry point, if you can check it when it first got to you?

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

["signature.asc" (application/pgp-signature)]

_______________________________________________
dbus mailing list
dbus@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dbus


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic