ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl5-porters
perl5-porters
Re: Every.pm on CPAN
by Ted Zlatanov other posts by this author
Jul 23 2008 1:42PM messages near this date
Re: Every.pm on CPAN | Re: Every.pm on CPAN
On Tue, 22 Jul 2008 16:05:43 -0700 chromatic <chromatic@[...].org>  wrote: 

c>  On Monday 21 July 2008 10:08:50 Ted Zlatanov wrote:
> > I just don't like creating extra iterator variables.  It feels
> > so... Java-ish :)

c>  If the question is between superglobal-per-iterable iterators as in Perl 5 or 
c>  multiple-no-shared-state-per-iterable iterators as in Java, I choose the 
c>  correct one.  That's Java, for once.

On Tue, 22 Jul 2008 01:37:46 +0200 Aristotle Pagaltzis <pagaltzis@[...].de>  wrote: 

AP>  Perlâ??s implicit iterators generally come from shell and sed. In
AP>  limited circumstances both languages are extremely handy, but
AP>  writing complex programs with â??feels like shell/sedâ? features
AP>  is not something to aim for.

I respectfully disagree a little.  Implicit iteration is very useful in
small scopes no matter the size of the program.  As the scope grows it
must either be refactored or the implicit iteration must be made
explicit with named iterators, but that doesn't mean I have to work in
every small scope with large-scope tools.

I guess the motivation of Every.pm was in fact that I want global
(large-scope) implicit iterators but don't want to manage them manually,
expecting them to spring into life every time I need them to count an
event.  I never thought of it that way.  Logically, the distinction is
between

"create this iterator and set it to roll at 500/in 5 seconds
...
call iterator"

or, the alternate

"create this iterator
...
call iterator and roll at 500/in 5 seconds"

and

"roll every 500 times/5 seconds you're here"

There's a mental tax on the programmer here with the iterator approach
no matter how it's implemented, because of the gap between creation and
use of the iterator and the extra variable introduced.

Sorry if this is badly off-topic.

Ted
Thread:
Ted Zlatanov
Abigail
Ted Zlatanov
Ben Morrow
Roland Giersig
David Nicol
Ted Zlatanov
Ted Zlatanov
David Nicol
Ben Morrow
Ted Zlatanov
Chromatic
Aristotle Pagaltzis
Nicholas Clark
Yitzchak Scott-Thoennes
David Nicol
Ted Zlatanov
Abigail
Ted Zlatanov
Abigail
David Nicol
Ted Zlatanov
Aristotle Pagaltzis
Ted Zlatanov
David Cantrell
David Nicol
Eric Wilhelm
David Nicol
Ben Morrow
Aristotle Pagaltzis
Paul Johnson
David Nicol
Eric Brine
Gisle Aas
David Nicol
Nicholas Clark

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved