[Swan-dev] *cmp is a little harder to read
D. Hugh Redelmeier
hugh at mimosa.com
Thu Nov 2 01:04:40 UTC 2017
I'm concerned about eb8a4265ffd98aa2f41a5b98c83876fcbfd19671
timers: add more generic deltatime_cmp()
expect use to follow the convention: deltatime_cmp(a, b) OP 0
for instance deltatime_cmp(a, b) <= 0; like strcmp() et.al.
It is true that *cmp is a more general primative. But it is also
harder to read code using it.
So: it is fine to add deltatime_cmp but I disagree with this comment:
+bool deltaless(deltatime_t a, deltatime_t b); /* obsolete; use deltatime_cmp() */
Uses of deltaless seem clearer to me than their replacement.
More information about the Swan-dev