|
From: Graeme G. <gr...@ar...> - 2007-06-12 00:16:15
|
Adam Kropelin wrote: > There is an argument to made for the API to be forgiving; you're > performing a read, so obviously you must have meant to provide an input > endpoint address. Since you didn't, the library will fix it up for > you. That type of API makes me uncomfortable; I don't like an API that > thinks it knows more about what I want to do than me...but some > people like to program that way. One solution (if there is a mechanism for it) would be for the API to fix it up and issue a warning. Those who are interested in clean code will note the warning and fix the parameter, others can ignore it. Another approach is to have "strict" and "forgiving" settings. Default to "forgiving", and those interested in cleaning up their code will turn on "strict". Graeme Gill. |