This proposal tries to address two problems: - for implementers: it is no clear what the difference between IMP_check and IMP_assert is and when one should be used and not the other - for users: getting nice feedback about incorrect usage of IMP also turns on all sorts of (slow) checks of various internal implementation details.
To address this, I propose: - provide IMP_implementation_check and IMP_usage_check macros - provide a methods to turn on and off the two different types of checks independently - remove the concept of check levels
To implement the proposal I would do: - replace all IMP_assert with IMP_implemenetation_check - replace all IMP_check with IMP_usage_check - debug mode, by default, has both sorts of checks enabled - release mode has just usage checks - fast mode has none
On 10/09/2009 03:58 PM, Daniel Russel wrote: > To address this, I propose: > - provide IMP_implementation_check and IMP_usage_check macros > - provide a methods to turn on and off the two different types of checks > independently > - remove the concept of check levels
Sounds reasonable to me. The only problem I have with it is that IMP_implementation_check is kind of long to type, and easy to misspell (as you in fact have already demonstrated later in your email!)
Ben
On Oct 9, 2009, at 4:20 PM, Ben Webb wrote:
> On 10/09/2009 03:58 PM, Daniel Russel wrote: >> To address this, I propose: >> - provide IMP_implementation_check and IMP_usage_check macros >> - provide a methods to turn on and off the two different types of >> checks >> independently >> - remove the concept of check levels > > Sounds reasonable to me. The only problem I have with it is that > IMP_implementation_check is kind of long to type, and easy to > misspell (as you in fact have already demonstrated later in your > email!) Agreed, anything shorter to suggest that gets the point across? Not that short would prevent me from misspelling it.
"internal" probably would do.
Perfect proposal, Daniel. A suggestion:
IMP_logic_check() IMP_usage_check()
If the logic is correct, all errors should come from usage, right ? Also I suggest that the messages start with the name of the function failing, like:
"MyFunction: I am failing here .... "
2009/10/9 Daniel Russel drussel@gmail.com
> > On Oct 9, 2009, at 4:20 PM, Ben Webb wrote: > > On 10/09/2009 03:58 PM, Daniel Russel wrote: >> >>> To address this, I propose: >>> - provide IMP_implementation_check and IMP_usage_check macros >>> - provide a methods to turn on and off the two different types of checks >>> independently >>> - remove the concept of check levels >>> >> >> Sounds reasonable to me. The only problem I have with it is that >> IMP_implementation_check is kind of long to type, and easy to misspell (as >> you in fact have already demonstrated later in your email!) >> > Agreed, anything shorter to suggest that gets the point across? Not that > short would prevent me from misspelling it. > > "internal" probably would do. > > _______________________________________________ > IMP-dev mailing list > IMP-dev@salilab.org > https://salilab.org/mailman/listinfo/imp-dev >
participants (3)
-
Ben Webb
-
Daniel Russel
-
Javier Ángel Velázquez Muriel