Classes vs. Function Librarys

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

Well I suspect that aspect is getting into personal preference. But I detest collections of static methods. There are a few times when its appropriate, but generally its a code stench.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

The following seems to be the new trend in PHP (Which i hate): Creating functionality through functions / classes that do exactly the same. An example: the new date handling..

Code: Select all

$tz = timezone_open('Asia/Singapore');
echo $timezone_name_get($tz);
VS

Code: Select all

$tz = timezone_open('CEST');
echo $tz->getName();
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

annoying yes, but allows people who do not understand/like/whatever OOP, the ability to perform the actions. Granted, I find it a bit lazy, but that's me.
bg
Forum Contributor
Posts: 157
Joined: Fri Sep 12, 2003 11:01 am

Post by bg »

feyd wrote:annoying yes, but allows people who do not understand/like/whatever OOP, the ability to perform the actions. Granted, I find it a bit lazy, but that's me.
I suppose anyone who doesn't like it could switch to jsp where you dont have much of a choice.
Post Reply