Re: convert numerical day of week
| From: | Robin Vickery | Date: | Wed, 23 May 2007 07:31:59 +0000 |
| Subject: | Re: convert numerical day of week | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-255369@lists.php.net to get a copy of this message | ||
On 22/05/07, Robert Cummings <robert@interjinn.com> wrote:
On Tue, 2007-05-22 at 13:47 -0500, Greg Donald wrote: On 5/22/07, Robert Cummings <robert@interjinn.com> wrote:they're all bloated: print jddayofweek($day_number, 1); -robinNothing said it was important, but why implement a half-assed solution when you can implement a superior solution in as much time?Your solution contains overhead you don't even know you need. Coding for locales is an edge case since most PHP installs will find the server settings sufficient. http://en.wikipedia.org/wiki/YAGNII'll accept ignorance and sloppiness as reasons... albeit not good reasons.You assume too much and your solution is bloated. Accept that. No, your solution is bloated. Mine may run a tad slower, but it consumes less memory since it uses the weekday names already defined in the locale. Yours redefines the strings thus requiring that much extra storage. Yours is redundant with information already available in the locale. The YAGNI claim is irrelevant here since I'm producing the requested functionality that the poster obviously needs. Whether I use your method or my method is irrelevant to YAGNI.