octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Removing input validation from private/ leaf functions


From: CdeMills
Subject: Re: Removing input validation from private/ leaf functions
Date: Wed, 10 Jul 2013 00:38:52 -0700 (PDT)

Rik-4 wrote
> As a representative sample you could take a look at isequal and isequaln
> which both call __isequal__ underneath.  I don't see why __isequal__ needs
> to check nargin since there are only two callers in the entire m-file tree
> and they are calling it correctly.

Old problem in computer programming. The trade-off is between the cost of
doing the validation, and the cost of the error produced in case of no
validation.

I would be tempted to say 'you'll never know'. While developping code, tests
are very usefull. And once the code is stabilised since a long time, it is
good to leave the test inside code, in case some new programmer restart
developping and forget that some convention must be obeyed. Better sure than
sorry.

Regards

Pascal



--
View this message in context: 
http://octave.1599824.n4.nabble.com/Removing-input-validation-from-private-leaf-functions-tp4655466p4655468.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]