Website slideshow made easy with jQuery
Taken from my reply to a post regarding the topic on Facebook, a few words introducing key guidelines I follow when commenting my code. Regarding classes, I like to provide a class summary stating the intent and purpose. Accessors, Mutators, Constructors – I don’t feel the need to comment them as their roles are (and should be) rather self-explanatory.… Read the rest
Code Commenting – a delicate art of balance
One of PHP’s less known language constructs is list(), very useful for unpacking indexed arrays. Consider the following simple example denoting its usage: <?php //populate an array with values $record= array('me', '1.800.123.4567', 'me@example.com'); //unpack the array into variables, skipping the phone number list($name, , $email) = $record; //print the output echo("name: $name; email: $email"); ?> This clean, readable, scalable approach is great for processing data records, unpacking an SQL result row, etc.… Read the rest
Array unpacking in PHP