Re: Long Live GOTO

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

 



NO "GO"!
As one who started back in the 70's with old style coding that utilized GoTo 
in Cobol, Fortran, etc. and had to deal with "spaghetti code" written by 
even earlier developers who never considered that someone else would have to 
maintain their code, I feel strongly that GoTo is not to be used.

There are many ways of avoiding the perceived need for a GoTo statement. 
The 'Break' is one in PHP as is the 'Continue'.  Better instruction in 
programming since the 70's has taught beginning coders the value of 
well-structured code using function calls and distinct paragraphs (if you 
will) of code that help to structure the entire process into manageable 
chunks to facilitate understanding and maintenance.  Random GoTos 
interspersed into code because a designer just hasn't taken the time to 
write it well is just not smart.  Think of a well-written article in a 
journal or newspaper.  Do you think that the author just threw it together 
and the points to be made just fell out of it?  No - that writer probably 
spent a good amount of time re-working his first draft into second and third 
drafts before getting his thoughts and words in the right order to 
facilitate the presentation of the ideas he was trying to communicate.  The 
same process can and should be brought into play when writing code and in 
that way produce a quality product that will stand the test of time and lend 
itself easily to necessary improvements when needed.

My $.02.


"Adam Richardson" <simpleshot@xxxxxxxxx> wrote in message 
news:CAC6CJqYLdqSih0+v=X78LnB_wuN7sqMctKxDC0790Th7c-Cd6g@xxxxxxxxxxxxxx...
> Hi,
>
> 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:
>
> 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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