[FFmpeg-devel] [PATCH] RoQ encoder

Måns Rullgård mans
Sun May 6 00:46:02 CEST 2007


The Wanderer <inverseparadox at comcast.net> writes:

> 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.

I suggest you read the attached text and show it to structured
programming zealots you may encounter.

-- 
M?ns Rullg?rd
mans at mansr.com

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: structured_programming.txt
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070505/db07d570/attachment.txt>



More information about the ffmpeg-devel mailing list