News Feed
Sections




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

Brandon Savage's Blog:
Stop Sacrificing Readability For Efficiency!
March 27, 2009 @ 12:58:28

Brandon Savage has a recommendation fro developers out there - sometimes readability is more important than any micro-efficiency you might gain in your scripts.

Much was made last week over the topic of micro optimization in PHP. Most of these argued that micro optimization was a bad idea. [...] There's another reason that micro optimization can be a bad choice: it makes code absolutely impossible to read!

He points out one example for validating the length of a string in two ways - one using isset to tell which characters in a string are set and the other using the tride and true call to strlen. The first, while benchmarked to give you a (very tiny) improvements, is harder to read at first glance than the check to the string length.

0 comments voice your opinion now!
readability efficiency performance microoptimizations benchmark


blog comments powered by Disqus

Similar Posts

Zend Developer Zone: Enhance performance with Zend_Cache

PHPClasses.org: Lately in PHP, Episode 26 - Accelerating PHP 5.4 with updated PHP cache extensions

Zend Developer Zone: Webinars: Upcoming Zend Webinars (Zend Server, Magento, Performance, IBM i)

Terry Chay's Blog: How much does a date() cost?

Harrie Verveer's Blog: Benchmarking Xdebug


Community Events





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


release introduction framework podcast language community series interview library list laravel api project bugfix code wordpress threedevsandamaybe application configure developer

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