[FFmpeg-devel] [PATCH] RoQ encoder

The Wanderer inverseparadox
Sat May 5 13:53:06 CEST 2007


Rich Felker wrote:

> On Sat, May 05, 2007 at 12:57:35AM +0100, Robert Swain wrote:
> 
>> Out of personal interest and being a lesser experienced programmer,
>>  I've always been lead to believe that 'goto' shouldn't be used
>> unless absolutely necessary. Grepping the FFmpeg source throws up
>> far more results than I expected so now I'm wondering - why have
>> you suggested the use of goto over something like a 'while' loop?
>> If it's better to use a goto in some cases, I'd like to know when
>> and why. :)
> 
> This is nonsensical dogma. Continue and break statements are exactly 
> the same thing as goto.

My understanding of the same "rule" is that it likewise would forbid use
of 'continue' and 'break' statements - except, in the latter case, in
'switch' statements - on the structured-programming principle of "there
is only one place to exit the loop" (that being at the point where the
condition is tested). My understanding was that the only "correct" way
to break out of a loop on such a condition is to use flag variables and
test their values both in the loop header and wherever necessary inside
the loop.

This is, of course, quite clunky in some cases, and I've ignored it a
few times in my own coding, but I've always felt a little uncomfortable
doing so.

-- 
       The Wanderer

Warning: Simply because I argue an issue does not mean I agree with any
side of it.

Secrecy is the beginning of tyranny.




More information about the ffmpeg-devel mailing list