Hehe. Nonsense! But perhaps we can evolve this thread into something a little more meaningful
I used to wrap a lot of my items in functions. For
$_GET I used to have
g(),
$_POST was
p(), and
$_GET/
$_POST was
gp(). These are all fine and dandy but they don't describe too well what is happening inside that function. Whether it's setting or getting, what it's setting or getting.
I was working with the open-source eCommerce system, Magento, a couple of weeks ago now, and I noticed, much to my disgust, that they were using function names with two underscores (
__) to print labels. What were they thinking?
For instance:
php Code:
function __
($szText){ return $szText;
}echo __
('I love TalkPHP');
As it is, however, I much prefer the use of
print and
echo. They describe well what is happening, and in themselves they are not functions, but rather language constructs. Wrapping them in functions, insofar as I see, isn't preferable, particularly in terms of readability.
In addendum, I even dislike using
printf , especially in amongst
echoes and
prints, because, from a superficial perspective, they are highlighted differently in Zend Studio, and the
printf requires the items to be passed as arguments, unlike
print and
echo. It creates a mess!
I now always follow the rule that everything must describe, as best as they can, what its purpose is.