in reply to Re^2: C/C++ type assert() in Perl?
in thread C/C++ type assert() in Perl?
I learned that asserts are supposed to be used to
guarantee that the programmer did not make a mistake in
his coding, and pass in bad values to a subroutine.
In the case of the credit card, it would be pointless to assert() that the card is active.
It would be prudent, however, to assert() that the program passed in a valid card to
the subroutine that checks for active cards. Whether or not the card is active is not
a programming error. Not passing a valid card in certainly is.
guarantee that the programmer did not make a mistake in
his coding, and pass in bad values to a subroutine.
In the case of the credit card, it would be pointless to assert() that the card is active.
It would be prudent, however, to assert() that the program passed in a valid card to
the subroutine that checks for active cards. Whether or not the card is active is not
a programming error. Not passing a valid card in certainly is.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: C/C++ type assert() in Perl?
by waswas-fng (Curate) on Jun 17, 2004 at 16:50 UTC |
In Section
Seekers of Perl Wisdom