 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Ibuildings Blog: Implementing Iterators
by Chris Cornutt August 20, 2008 @ 15:02:59
On the Ibuildings blog Ruud Alberts takes a look at iterators - what they are and how they're used (including the objects the SPL makes available).
Let's kickstart this blogpost by defining what an iterator actually is. According to wikipedia, an iterator is. A collection can pretty much be anything. The most obvious sources would be arrays, but other than that, iterations can be done over database resultsets, strings, datetime intervals, directories, file content and XML listings, to name a few.
He looks at the iterator interface that comes bundled in the SPL and how you can create a custom one to loop through your own data collection. He includes an example - a colorful string iterator that "pretties up" an HTML string with various colors.
voice your opinion now!
iterator standard library spl custom color string tutorial
Make Me Pulse Blog: PHP6, Unicode and TextIterator features
by Chris Cornutt March 14, 2008 @ 09:32:34
On the Make Me Pulse blog, there's a look at PHP6's support of Unicode in the SPL (Standard PHP Library) TextIterator handler.
I've just install the last version of PHP6 dev and I've decided to test the famous new feature, the PHP Unicode Support. I will not explain new things about PHP6 or Unicode or TextIterator, it's just my discoveries test on this features.
He steps through the process he followed - enabling Unicode support, testing various output methods (including just an echo and using the TextIterator) as well as some of the manipulation methods (next/first/current) that can be used to get certain characters out of a string.
voice your opinion now!
php6 unicode textiterator spl standard php library enable
Paul Jones' Blog: Line Length, Volume, and Density
by Chris Cornutt March 11, 2008 @ 09:33:00
In a new blog post, Paul Jones looks at three aspects of coding style - line length, volume and density - and how different people have different assumptions as to what's "right".
When it comes to coding style, there are are various ideas about how you should write the individual lines of code. The usual argument is about "how long should a line of code be"? There's more to it than that, though. Developers should also take into account line volume ("number of lines") and line density ("instructions per line").
He mentions the PEAR style guide when talking about line length, reading code like and sentence in line volume/density and how the "shorter is better" concept can be pushed to its extreme limits taking code into the unreadable zone.
voice your opinion now!
coding standard style volume length density
PHP-Coding-Practices.com: PHP Code-Beautifier Tool
by Chris Cornutt May 03, 2007 @ 07:54:00
On PHP-Coding-Practices.com, there's a new post pointing out a code beautification tool Tim dug up the (aptly named) "PHP Code Beautifier".
Today I discovered a good tool for beautifying existing PHP Code. It works via a web interface. You can either upload a script or directly input it. The code is beautified according to the PHP PEAR Standard Requirements. It does not change or debug your code in any way.
He lists the things it can do for you and your code including setting indents to four spaces, uses the "one true brace" style for function definitions, and removes spaces between things like function calls, parenthesis and beginning of argument list.
You can check out the application and get information on more of the updates it will make on the project's homepage.
voice your opinion now!
code beautifier download pear standard code beautifier download pear standard
|
Community Events
Don't see your event here? Let us know!
|