Re: Preliminary Proposal for calculator for suntimes / moontimes
| From: | Stefan Neufeind | Date: | Wed, 27 Aug 2003 15:35:46 +0000 |
| Subject: | Re: Preliminary Proposal for calculator for suntimes / moontimes | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-20647@lists.php.net to get a copy of this message | ||
On 27 Aug 2003 at 11:08, Alexander Wirtz wrote:
> while working on the weather-class, I wrote two other classes, at the
> moment called Date_Sun and Date_Moon
> http://www.pc4p.net/downloads/Sun.phps
> http://www.pc4p.net/downloads/Moon.phps
>
> The problem now is, how to call the package as a whole? Pierre
> suggested to include them directly in Date, but I'm not convinced,
> that this is a good idea, I would like to keep them seperate. I'm well
> aware, that PHP5 has implemented suntime-functions, so my suggestion
> is, to keep two different packages Date_Sun and -_Moon, so that it is
> easier to trash Sun afterwards. That means maintaining two packages,
> but that's ok with me.
>
> Please take into consideration, that I want to use them both as an
> optional package in Science_Weather (or what it will be called...)
I'd also prefer to see them inside Date. Adding two additional files
seems okay - but there is no need for a separate package - or even
two. Please talk to the devs of Date about an integration.
About suntime-functions in PHP5:
I believe even when PHP5 comes out (at the end of the year) there
will still be some (many?) PHP4 system out there for a long time. For
sure the php-functions will be faster. So could you maybe implement
detection of the php5-functions and if they exist make Sun / Moon be
a wrapper for the PHP5-functions? This way your packages would be
independent of PHP4/5 but could take advantage of the fast, internal
PHP5-functions (written in C).
About your code:
Could you maybe do some cleanups in the _doCalculation-code?
Especially about all those variables. Variables should generally
start with a low-case-character afaik - and more meaningful names
might also be a good idea :-) This would make it easier to search for
errors (if any might arrise) or study the function of your class.
Maybe use some more constants as well to clear of all those integer-
/ double-values in your calculations.
Generally:
I like what you propose - and I know that they might even be useful
for other people. But I'm willing to delay my vote until the code has
been cleared up and you hopefully have arranged integration into
Date.
Stefan