Below From: Gregg Reynolds [mailto:[email protected]] Sent: Tuesday, January 2, 2018 9:17 PM To: Dave Thaler <[email protected]> Cc: iotivity-dev <[email protected]> Subject: Re: [dev] Proposed API guidelines
On Jan 2, 2018 7:18 PM, "Dave Thaler via iotivity-dev" <[email protected]<mailto:[email protected]>> wrote: Two new proposed API guidelines, please review: * A public API should not be added to Iotivity if there is already a non-deprecated API that can just as easily be used (i.e., with approximately the same number of lines of code). I don't understand this one. It seems to say you should not duplicate functionality (Principle of Parsimony?) Is that correct? Why does number of LOC matter? [DT] if it would take an app 50 lines of code to do something that most apps would do, then having a helper function expose that so an app can do it in one line of code is good for developers. But if an app could already do the same thing via a different API in one line of code, then having another API that does it is not good. I don’t mean to pick on anyone in particular, but IOT-2902 is one example that would be rejected under this parsimony principle; again I don’t want this thread to be a discussion about that ticket, this is a more general principle. * A public API should not be added to Iotivity if the API would provide generic functionality (i.e., not inherently OCF or Iotivity specific functionality) that could be provided by an external library. I guess by "API" you mean routine or function? So this rule says the Iotivity API should consist of primitives - if the proposed routine can be expressed in terms of existing (presumably primitive) routines it should be rejected. Yes? Principle of Simplicity? (Non-primitives add inessential complexity to the API.) [DT] I mean iotivity should not have public APIs for generic things like threading, synchronization, etc. So for example, octhread.h should not be made public and used by apps. gregg
_______________________________________________ iotivity-dev mailing list [email protected] https://lists.iotivity.org/mailman/listinfo/iotivity-dev
