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: | Paul Dragoonis | Date: | Fri, 22 Jun 2012 17:22:30 +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 | Groups: | php.webmaster |
| Request: | Send a blank email to php-webmaster+get-13763@lists.php.net to get a copy of this message | ||
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.
- Paul.