On 7/17/2011 3:39 PM, Derek Kulinski wrote:
Hello BGB,
Sunday, July 17, 2011, 2:51:40 PM, you wrote:
for example, if/while/for/... don't mean goto shouldn't exist in a
language or should be branded as "evil" as a result, rather they provide
better alternatives such that things like goto are more of a "break
glass in case of emergency" feature (or can be taken as a sign that,
when one finds themselves using it, then likely things have already gone
fairly far south as far as this particular code is concerned...).
Won't speak about other languages, but in C the goto is very useful
and actually when properly used can make code much cleaner.
It seems thought that it happens most around kernel code and kernel
drivers to free resources on failure for example:
http://tomoyo.sourceforge.jp/cgi-bin/lxr/source/drivers/crypto/geode-aes.c#L518
good point.
either way, it is still useful sometimes, whether or not one uses it as
a matter of style (the likely main alternative having been nested ifs or
if/else chains).
_______________________________________________
fonc mailing list
[email protected]
http://vpri.org/mailman/listinfo/fonc