Stoyan Stefanov has a fun little post showing an interesting formatting trick to make reading arrays/hashes easier:

Writing readable means proper indentation. Usually you’d tab (or use 2 or 4 or 3 spaces) after every curly bracket. [...] Same goes when you have a bigger hash/object sort of thing [...] But recently, inspired by Firebug’s Net panel way of presenting header information, I tried aligning the keys to the right in addition to aligning the values to the left.

Check out the entry for examples of each of these and see which might fit your style the best. Personally, the align right style looks nice but could be more of a pain than it’s worth to force my editor into.


Incoming Links (via Tecnorati):
Nothing Reported

Tags: , , , ,