Re: Suggested getIterator example

From: Date: Tue, 23 Jun 2009 07:15:12 +0000
Subject: Re: Suggested getIterator example
References: 1 2  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969380512@lists.php.net to get a copy of this message
On Tue, Jun 23, 2009 at 08:40, Kalle Sommer Nielsen<kalle@php.net> wrote: > Hi > > 2009/6/23 Karoly Negyesi <karoly@negyesi.net>: >> Hi, >> >> So I would like to add this but as this is a bit bigger and a bit >> different than the usual examples, I thought I will ask first. > > All in all the examples look good, but I don't think the example > para's should have been written like: > > "Instead of the following:" > <some long code> > > "You can use the much shorter:" > <some short code> > > I think they should be more descriptive, explaining what this does and > then the source code comments can indicate, you might want to do this > or that instead. Making it a classreference example and changing the descriptions to "the following two are examples are equal, one using Iterator and the other IteratorAggregate" (or something along those lines) would maybe be better? I think its valuable to show that you can reduce a lot of code using that interface.. -Hannes

« previous php.doc (#969380512) next »