[Ardour-Dev] Hello, some tech talk, etc.
razvanco at gmx.net
Thu Jul 5 12:02:56 PDT 2012
> tor 2012-07-05 klockan 09:17 -0500 skrev Gabriel M. Beddingfield:
> > On 07/05/2012 07:49 AM, Jonas Olson wrote:
> > > In this particular example, does the goto solution has any significant
> > > advantage over using if-else as follows?:
> > [snip]
> > Yes... when you have to have 5 of these conditional blocks it makes
> > things really cluttered in order to satisfy the "goto's are always evil"
> > rule.
It's a false choice between gotos and if/else or switch-based returns. The C++ way is RAII + throwing/catching exceptions.
Even with C, gotos are almost always a bad idea (the one case that Paul mentioned is where you need to escape from a considerable number of nested loops, but if you write code like that you have bigger problems). In my admittedly limited time with the Ardour code, I've yet to encounter that case, but did find plenty of gotos.
More information about the Ardour-Dev