mbeckerle commented on PR #1058: URL: https://github.com/apache/daffodil/pull/1058#issuecomment-1645793651
> Just a couple minor comments/questions. > > As to changing most usage calls to invariants, that doesn't seem totally unreasonable to me. However, I think it could be argued that the two are different things that could warrant different names. One check is bad parameters passed into internal functions, and one is checking for bad internal state. You could argue different function names might make it more clear what's being checked (e.g. internalUsage() vs invariant() or something), but I'm not sure there's a lot of extra benefit. It both cases, a failure represents an internal bug in Daffodil, so calling invariant seems reasonable, and is definiely simpler. But I don't feel strongly about it. I could be swayed either way if there is a preference for separate function names. > > @mbeckerle any thoughts? usage is "argCheck", and invariant is "stateCheck". Both are for our own internal use. These pre-date our API modules (JAPI/SAPI). Arguably those should document and throw specific exceptions from each public method. And we should define the exceptions they throw and convenient checker methods directly *in those modules themselves*. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
