Re: com web/php: Created some new classes to produce the articles view on the homepage. I'm trying to improve the backend code where I can and the
print_news function is pretty complex, so I went this route instead.: Entity/NewsItem.p
| From: | Hannes Magnusson | Date: | Sat, 23 Jun 2012 02:30:49 +0000 |
| Subject: | Re: com web/php: Created some new classes to produce the articles view on the homepage. I'm trying to improve the backend code where I can and the print_news function is pretty complex, so I went this route instead.: Entity/NewsItem.p |
||
| References: | 1 2 3 4 5 | Groups: | php.webmaster |
| Request: | Send a blank email to php-webmaster+get-13768@lists.php.net to get a copy of this message | ||
On Fri, Jun 22, 2012 at 6:22 PM, Paul Dragoonis <dragoonis@gmail.com> wrote:
> On Fri, Jun 22, 2012 at 5:56 PM, Levi Morrison <morrison.levi@gmail.com> wrote:
>> On Thu, Jun 21, 2012 at 11:33 PM, Stewart Lord <stewey@ambitious.ca> wrote:
>>
>>>
>>> When you are adding to an existing codebase it is good practice to match
>>> style. There is very little OO code in php.net. I think it is better to
>>> go with the flow in situations like this.
>>>
>>
>> I'm not saying OO is inherently superior to procedural programming; bad OO
>> is probably worse than bad procedural programming because of its increased
>> complexity. However, I think we have a lot of *bad* procedural programming
>> on PHP.net. I don't feel like it's appropriate to just go with the flow
>> when that is the case. However, if that is the general consensus I will
>> play nice and write procedural code instead of using OO code.
>
> Don't be hesitant to write OO, especially clean Entity objects for
> things like News. That's going to really help clean up our codebase in
> places where there's nasty inline HTML within PHP and heredocs.
Fascinating. I really do not see the need to break code that works
perfectly, just for the sake of breaking it.
There is no need to rewrite anything here. Couple of markup
adjustments may be appropriate here and there, but that is about it.
And if you don't need to adjust the markup, then what is the point of
changing the code?
Keep also in mind that people do all sorts of things with the current
website, all kinds of screen scraping and data extraction from eRDF to
RDFa and microformats, so please be extra careful when changing
markup.
-Hannes