Re: Long Live GOTO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 6, 2012 at 4:25 AM, Adam Richardson <simpleshot@xxxxxxxxx>wrote:

> On Mon, Feb 6, 2012 at 4:07 AM, Tim Streater <tim@xxxxxxxxxxxxxxxx> wrote:
>
>> On 06 Feb 2012 at 07:47, Adam Richardson <simpleshot@xxxxxxxxx> wrote:
>>
>> > While not purely focused on PHP, I toss this out to the group because I
>> > believe there are some novel, interesting points regarding the potential
>> > benefits of using the goto construct as implemented in PHP:
>> >
>> > http://adamjonrichardson.com/2012/02/06/long-live-the-goto-statement/
>>
>> Your val_nested() function looks like a straw-man to me. I've not used a
>> goto since I stopped writing in FORTRAN in 1978, and not missed it [1].
>> Neither do I ever have deeply nested if-then-else - these are a good source
>> of bugs. I suppose the rest of your article might have been dealing with
>> simplifying val_nested() but TBH I wasn't interested enough to find out.
>>
>
> I disagree that the nested function is a straw-man. I (just as the other
> authors I'd linked to describing the "arrow" pattern of code) have seen
> plenty of examples of similar code.
>
> PHP provides a restricted implementation of the goto construct that, in my
> opinion, can hold great value for developers.
>
> Thanks for the feedback,
>
> Adam
>

Tim,

One quick follow-up. I'd thoroughly enjoy viewing a refactored version of
the val_nested() function from you (or anyone one else on the list) to see
the techniques PHP users tend to use to avoid the deep nesting.

That would be very useful in terms of properly evaluating the range of the
possible refactoring options and PHP user preferences.

Thanks again,

Adam

-- 
Nephtali:  A simple, flexible, fast, and security-focused PHP framework
http://nephtaliproject.com

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux