Re: [PEPr] +1 for Networking::Monitor

From: Date: Fri, 17 Dec 2004 08:48:36 +0000
Subject: Re: [PEPr] +1 for Networking::Monitor
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-35126@lists.php.net to get a copy of this message
Justin Patrin wrote:
(Optional) In Net_Monitor_Service_SMTP::check I would prefer the if blocks to be switched (i.e. don't use a ! in the if()). (I know that this is a very nit-picky kind of thing, it's just a suggestion. It makes sense IMHO, though.) Hi Justin,
Such tiny observations are certainly needed, In fact, they seem the onliest ones that PEAR people do. But a machine could do that (some Beautifer program) Some more consideration of the code's structure should be done ! That would better help the developper. Here, Robert's package furnish a good example. As a whole, it's indeed nice, the OO design is perfect. I mean the overall organization is not in question. It's more the code structure within the methods. e.g. this stateDiff() methods. I've sent an optimized version to Robert which for around 1000 services gives the result 200 times faster ... The code is also more directly readable. I'm working around a more faster version. Also check the Alerter/SMTP.php: Some stuff should go out of the loop to build the message: not making the same test (with '!' or without is no care) for each service to send. The internal arrays exchanged between methods doesn't need to be associative. The services check return the host and service, but they are fixed parameters, it will become a mess if this check method changed it. Anycase as they *must* stay the same, better not return them. Again, Robert's Net_Monitor is a nice stuff ! What I suggest is more some code optimization, anyway better to be done before package's release, just now. I understand it's impossible for a PEAR guy to check all packages, Anyway, such consideration as mine should not be thrown away immediatly with a "let Robert rules what he puts in the code" what is a "don't care" answer I got once. Hmm, you are right, also IMHO direct tests without '!' are a more positive way of coding. Best -- bertrand Gugger

« previous php.pear.dev (#35126) next »