[Cryptography] GnuTLS -- time to look at the diff.
Dave Horsfall
dave at horsfall.org
Thu Mar 6 17:53:43 EST 2014
On Thu, 6 Mar 2014, Phillip Hallam-Baker wrote:
> People can write good code using gotos... but most do not
>
> People can write code without memory leaks in C or C++... but most don't
>
> People can write comprehensive test suites for certificate checking... but
> so far none has been mentioned so I don't think they did.
You forgot one:
People can write good code without using GOTOs whatsoever, but most do not.
The argument that GOTOs can be used for error conditions is specious; my
coding style:
if (some error)
cleanup(N); // final exit code
...
// All done, now finish
cleanup(0);
void
cleanup(int err)
{
// necessary cleanups
...
exit(err);
}
Use your imagination for the actual cleaning up; it could involve a list
of call-out functions, for example.
As I said before, I cannot remember the last time I used a GOTO. Then
again, it got drilled into us in Computer Science to only have a single
exit point.
-- Dave
More information about the cryptography
mailing list