Re: variables in namespaces, was: On closures and lamdba

From: Date: Wed, 24 Feb 2010 12:11:07 +0000
Subject: Re: variables in namespaces, was: On closures and lamdba
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.internals 
Request: Send a blank email to internals+get-47050@lists.php.net to get a copy of this message
On Wed, Feb 24, 2010 at 02:20:38PM +0300, Alexey Zakhlestin wrote: > > On 24.02.2010, at 13:28, Alain Williams wrote: > > Objects are not always the answer. > > in situation, which you described, objects are definitely the answer. > you have several functions, which share the same "state". that's very close to > the definition of object. Maybe 'private static' -- ie shared between different objects. It is not always appropriate, eg a generic logging function, called from all over the place - it is not always convenient to pass a logging object around; you just want to call the logging function. OO is not always the answer. -- Alain Williams Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer. +44 (0) 787 668 0256 http://www.phcomp.co.uk/ Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php Past chairman of UKUUG: http://www.ukuug.org/ #include <std_disclaimer.h>

« previous php.internals (#47050) next »