Click here to Skip to main content
15,915,324 members

Survey Results

Who should take responsibility for library function calls?   [Edit]

Survey period: 17 Feb 2003 to 23 Feb 2003

When a library function is called, who is responsible for ensuring that the input data will not cause a program to crash, or worse - be susceptible to a security hole?

OptionVotes% 
The programmer calling the function should ensure the supplied input data is valid.11210.82
The programmer who wrote the library function should ensure that all input data is valid.43341.84
Both library function writer and caller should validate all input data independently.44042.51
Neither - just use try...catch blocks to handle any problems.504.83



 
GeneralRe: Open Source Pin
#realJSOP18-Feb-03 2:21
professional#realJSOP18-Feb-03 2:21 
GeneralRe: Open Source Pin
Anders Dalvander18-Feb-03 2:39
Anders Dalvander18-Feb-03 2:39 
GeneralRe: Open Source Pin
#realJSOP18-Feb-03 3:42
professional#realJSOP18-Feb-03 3:42 
GeneralRe: Open Source Pin
Anders Dalvander18-Feb-03 5:16
Anders Dalvander18-Feb-03 5:16 
GeneralRe: Open Source Pin
Anonymous18-Feb-03 5:18
Anonymous18-Feb-03 5:18 
GeneralRe: Open Source Pin
Anders Dalvander18-Feb-03 7:19
Anders Dalvander18-Feb-03 7:19 
GeneralRe: Open Source Pin
Anders Dalvander18-Feb-03 5:34
Anders Dalvander18-Feb-03 5:34 
GeneralIt depends... Pin
Paul M Watt16-Feb-03 18:29
mentorPaul M Watt16-Feb-03 18:29 
That topic should be determined before hand depending on the type of data and solution that is to be written. In most cases I would say the library should validate the data and handle errors, because people tend to look at functions as a black box. However, for a particular implementation, it may be more efficient for the caller to verify their data.

For example, take a 3D rendering program that must process millions of polygons, it would waste a lot of time to process each polygon separately in a library function, however if the caller could verify the data all at once before calling the processing function, that would probably be more efficient.

The bottom line is, it is difficult to always classify the solution in software engineering, as the solution usually depends on the domain of the problem.




Build a man a fire, and he will be warm for a day
Light a man on fire, and he will be warm for the rest of his life!

GeneralRe: It depends... Pin
Jeff J16-Feb-03 21:39
Jeff J16-Feb-03 21:39 
GeneralRe: It depends... Pin
Navin17-Feb-03 7:56
Navin17-Feb-03 7:56 
GeneralAnd then...? Pin
Shog916-Feb-03 18:10
sitebuilderShog916-Feb-03 18:10 
GeneralRe: And then...? Pin
NormDroid17-Feb-03 3:07
professionalNormDroid17-Feb-03 3:07 
GeneralRe: And then...? Pin
Tim Smith17-Feb-03 8:06
Tim Smith17-Feb-03 8:06 
GeneralRe: And then...? Pin
#realJSOP18-Feb-03 2:18
professional#realJSOP18-Feb-03 2:18 
GeneralRe: And then...? Pin
bgiraya18-Feb-03 4:28
bgiraya18-Feb-03 4:28 
GeneralRe: And then...? Pin
Lunchy17-Feb-03 4:09
Lunchy17-Feb-03 4:09 
GeneralRe: And then...? Pin
Jon Taylor17-Feb-03 22:34
Jon Taylor17-Feb-03 22:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.