Hi everyone,
we just discussed 'function wrapper' topic offline.
I agree that it is not ideal to add new parameter to the function. And I
agree that in languages like C, we have return value model.
On the other hand, we have clean code on our minds. So I think that
wrappers like:
# int func(a, b, c, d);
# int func_with_warns(a,b,c,d);
are better if we use func() very often. Why? The reason is that we look
at func() as to something which do one thing or one thing with printing
warnings. So we can quickly check if every occurrences are right or not.
It could be confusing if we needed to check something like:
# int ret;
# ret = func(a,b,c,d);
# if (ret != EOK) {
# }
# ...
# if (ret == WARNS) {
# LOG(...);
# }
Regards
Petr
PS: I didn't read the thread, so it is only my 2 cents.
_______________________________________________
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/sssd-devel