Published by Jonathan Weatherhead

Jonathan Weatherhead is a code scientist, software developer, internet enthusiast, gadget fanatic, hobbyist photographer, and fun-lover extraordinaire. He has received a Bachelor of Computer Science and math minor from Carleton University and his areas of interest include web-driven applications, Object Oriented architecture and language paradigms.

Website
http://planetjon.ca

Website slideshow made easy with jQuery

Original article from http://planetjon.ca/2011/07/12/website-slideshow-made-easy-with-jquery/ I just wanted to share this gem that I stumbled upon. If you’re looking to add a slideshow or image slider to your website, this Cycle plugin built on jQuery is a really painless way of going about it.… Read the rest

Code Commenting – a delicate art of balance

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

Array unpacking in PHP

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