Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Dynamically Typed:
More on PHP 5 Standard Library
Sep 22, 2004 @ 12:55:14

Over on Dynamically Typed today, there's a new posting continuing Harry's discussion of the PHP 5 Standard Library (and how Marcus Boerger thinks it could be corrected).

Marcus makes a very good point about the DirectoryReader example I used: Your DirectoryReader is wrong. It does the non file skipping in valid, but it should be done in next(). But after the necessary changes it still has a major design flaw. It uses recursion. And Iterators are about unfolding. So what you should do is preventing that recursion and if you look at the result and how much it took you to complete it correctly you see why using FilterIterator would have been better.

I also find it interesting that, due to one comment in the comments of this article, things got completely off topic. Thankfully, by the end, it gets back under control with a question pertaining to the creation of an abstract OuterIterator class.

tagged:

Link:


Trending Topics: