05-11-2009, 06:40 PM
|
#9 (permalink)
|
|
The Contributor
Join Date: Dec 2007
Posts: 60
Thanks: 5
|
Quote:
|
Originally Posted by Salathe
Rather than wrapping the meat of a method within an if statment, determine whether the cache is available and return early instead. For example:
|
Uhm.. Both of our methods return at the same rate.. It's just a matter of design preference
And what's wrong with including a singleton method? You don't have to use it. It's there for the people that can find use for it
Also, care to elaborate on your usage of empty() instead of the !== operator? By default $data is set to null, so it's safe to use it.
|
|
|
|