3 ms·
Because the caller shouldn't know specifics on what is valid for the callee unless the caller has a specific and different value of valid. You don't leak inform
by nwmcsween 10y ago
Because the caller shouldn't know specifics on what is valid for the callee unless the caller has a specific and different value of valid. You don't leak information from separate functions this is how you get brittle garbage code.
- programmer_dude 10y ago> caller shouldn't know specifics on what is valid for the callee Why? How do you even use an API if you don't know what you can pass into it?
- nwmcsween 10y agoFor example strtol, you may pass whatever (implicitly nul terminated, which is bad) and it either returns a value or an error. I wasnt advocating _you_ don't know what to pass but that the caller doesn't include specifics of the callee.