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

Christoph Dorn's Blog:
TIP: FirePHP data volume filtering
Oct 18, 2010 @ 14:57:58

Christoph Dorn has posted a tip for those using the FirePHP tool in their debugging - a way limit the output results (like only part of a huge array of database results).

Array and object values may contain a lot more data as FirePHP traverses them (all array elements and object members) until the complete or maximum depth is reached. This is also true when logging exceptions and traces where all function and method arguments are also traversed. The data volume can quickly grow to megabytes which has fatal consequences for transmission of the debug data to the client and the client being able to render it.

The FirePHPPCore API gives you a way to set this maximum depth level bu setting either a "maxArrayDepth" or "maxObjectDepth" on the FirePHP object before sending it out to the logger. There's also a handy feature that, instead of limiting the depth, can filter out just the elements you're interested in. Code snippets for this and a Zend_Log_Writer_Firebug example are all included.

tagged: firephp debug filter volume array object zendwriter

Link:

Paul Jones' Blog:
Line Length, Volume, and Density
Mar 11, 2008 @ 14: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.

tagged: coding standard style volume length density

Link:


Trending Topics: