Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: goto (was browser output)
"Michael Carman" <mjcarman@mchsi.com> wrote in message
news:clousn$9421@onews.rockwellcollins.com...
> Laura wrote: 
>
> There *are* occasions when goto is necessary, just like there are
> occasions when using symbolic references is necessary. Both situations
> are very rare, but it does happen.
>
> That said, Perl has three flavors of goto, which are not all the same:
>
>    goto LABEL
>    goto EXPR
>    goto &NAME
>
> The first two are the traditional "jump to someplace else" that's
> generally considered bad. goto &NAME is very different: it replaces the
> current subroutine with the one referenced. While the first two forms
> are shunned, the third is quite common (e.g. in an AUTOLOAD).

I notice that File::Compare and File::Copy both make extensive use of goto
LABEL.

Anyone care to comment on whether it's really needed in these modules?



Report this thread to moderator Post Follow-up to this message
Old Post
Tintin
10-28-04 01:56 PM


Re: goto (was browser output)
Tintin <tintin@invalid.invalid> wrote in comp.lang.perl.misc:
>
> "Michael Carman" <mjcarman@mchsi.com> wrote in message
> news:clousn$9421@onews.rockwellcollins.com... 
>
> I notice that File::Compare and File::Copy both make extensive use of goto
> LABEL.
>
> Anyone care to comment on whether it's really needed in these modules?

The question is not if it's needed, but if it is used reasonably.

Goto is evil when used as the primary means of flow control.  At the
time Dijkstra mounted his campaign against "goto", there were
languages (most notably Fortran), that *had* no other large-scale
flow control ("if" only worked on one statement).  That used to make
a mess of programs.  The campaign wasn't so much against the use of
"goto" by individual programmers (they often had no choice), but
to foster the design of "structured" languages that didn't force
"goto" upon their users.

These days there are no more mainstream languages that aren't
"structured", so nobody talks about "structured programming" anymore,
but everyone does it.  In that framework, the occasional "goto" is
no big deal, and it can be the operation of choice.

Anno

Report this thread to moderator Post Follow-up to this message
Old Post
Anno Siegel
10-28-04 01:57 PM


Re: goto (was browser output)
Tintin (tintin@invalid.invalid) wrote on MMMMLXXVI September MCMXCIII in
<URL:news:2ubo3fF27cah6U1@uni-berlin.de>:
^^
^^  I notice that File::Compare and File::Copy both make extensive use of go
to
^^  LABEL.
^^
^^  Anyone care to comment on whether it's really needed in these modules?


It's not really needed. But I don't understand the question.
I've noticed that File::Copy makes extensive use of 'while' and
lexical variables. Anyone care to comment on whether it's really
needed in these modules?

Almost any construct is not "really needed", because there's always
another way to do the same thing.


Abigail
--
:;$:=~s:
-:;another Perl Hacker
:;chop
$:;$:=~y:;::d;print+Just.$:

Report this thread to moderator Post Follow-up to this message
Old Post
Abigail
10-29-04 01:56 AM


Re: goto (was browser output)
Anno Siegel (anno4000@lublin.zrz.tu-berlin.de) wrote on MMMMLXXVI
September MCMXCIII in <URL:news:clqm9i$m3q$1@mamenchi.zrz.TU-Berlin.DE>:
//
//  The question is not if it's needed, but if it is used reasonably.
//
//  Goto is evil when used as the primary means of flow control.  At the
//  time Dijkstra mounted his campaign against "goto", there were
//  languages (most notably Fortran), that *had* no other large-scale
//  flow control ("if" only worked on one statement).  That used to make
//  a mess of programs.  The campaign wasn't so much against the use of
//  "goto" by individual programmers (they often had no choice), but
//  to foster the design of "structured" languages that didn't force
//  "goto" upon their users.
//
//  These days there are no more mainstream languages that aren't
//  "structured", so nobody talks about "structured programming" anymore,
//  but everyone does it.  In that framework, the occasional "goto" is
//  no big deal, and it can be the operation of choice.


Let me also point to Donald Knuths "Structured Programming with goto
Statements", where he shows that using goto and structured programming
aren't multiple exclusive.



Abigail
--
A perl rose:  perl -e '@}-`-,-`-%-'

Report this thread to moderator Post Follow-up to this message
Old Post
Abigail
10-29-04 01:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Miscellaneous archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:16 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.