Re: strict nannying ...
| From: | Stuart Dallas | Date: | Sun, 15 Apr 2012 15:47:18 +0000 |
| Subject: | Re: strict nannying ... | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-317557@lists.php.net to get a copy of this message | ||
On 15 Apr 2012, at 15:02, Lester Caine wrote:
> Stuart Dallas wrote:
>> No code duplication but clear separation between static and instantiated usage. However,
>> this is not the best way to structure this code IMO. The better option would be to extract the
>> static parts into a separate class, and use that new class from the instantiated version.
>
> I've sort of got a problem with that since duplicating every content package class and
> then deciding which version I should be accessing does not make sense.
I didn't suggest duplicating anything, just separating the elements so there's a clear
distinction between static and instantiated. This is basic software engineering if you ask me. I was
going to rant about defensive programming here, but life's too short!
> I'm slowly pulling the 'static' elements into their own function and leaving the
> instantiated elements alone but it's slow work. Those people who kept telling me 'just fix
> the errors' simply don't understand how complex that CAN be :( I've only worked my
> way through half a dozen packages and I've 20 or so to go ... all just to bring things 'up
> to acceptable php code' ;)
It is as simple as that. Fix the errors. There may be a lot of them, and there may be complex
interplay between different parts of your code, but it's still as simple as just fixing the
errors.
-Stuart
--
Stuart Dallas
3ft9 Ltd
http://3ft9.com/