News Feed
Sections




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

Stoyan Stefanov's Blog:
Fancy Formatting
December 21, 2007 @ 12:06:00

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

Writing readable code 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 techniques and see which might fit your programming 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.

0 comments voice your opinion now!
formatting fancy hash object align right` formatting fancy hash object align right`


blog comments powered by Disqus

Similar Posts

Hasin Hayder's Blog: Facebook data storage api can really be the replacement of memcache

DevShed: Overloading and Object-Oriented Programming with PHP 5

NETTUTS.com: Real-World OOP With PHP and MySQL

Dennis Hotson's Blog: PHP Object Oriented Programming Reinvented

DevShed: Working with Prepared Queries with PDO Objects in PHP 5


Community Events





Don't see your event here?
Let us know!


laravel list framework podcast unittest developer wordpress opinion refactor series threedevsandamaybe testing introduction language code release interview experience install community

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework