[Kamailio-Devel] Use of goto

Raúl Alexis Betancor Santana rabs at dimension-virtual.com
Thu Jan 29 11:37:20 CET 2009


El Jueves, 29 de Enero de 2009 10:23, Daniel-Constantin Mierla escribió:
> probably making complex goto-based programming is a nightmare. But
> sometimes, as some of you expressed, it makes the code cleaner. I tend
> to use goto for two cases:
> - error handling - where some cleanup is required, also helps if the
> return code needs to be updated

I prefer macro-expansion, you just update the #define and all will be ok.

> - processing done - for the reason of cleanups (lock releasing) and
> having one return statement in order to spot quickly the return code in
> case of ok.

Maybe ... but better if you don't use that.

> Anyhow, probably is (will be) the developer choice, as long as it has no
> big impact, code beautifications are always subject of taste.

Yes, it will be developer choice, but we are a comunity, so we must have a 
code style guide, and IMHO on that guide, use of goto must be disallowed.

Just an opinion

-- 
Raúl Alexis Betancor Santana
Dimensión Virtual



More information about the Devel mailing list