> -----Original Message-----
> From: David Harkness [mailto:davi...@highgearmedia.com]
> Sent: Wednesday, December 08, 2010 10:46 AM
> To: Paul M Foster
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] new keyword combined with other things...
> On Wed, Dec 8, 2010 at 9:31 AM, Paul M Foster
> <pa...@quillandmouse.com>wrote:
> > I agree. My advice for SQL is always to learn SQL rather than use a
> > bunch of active record functionality. But I'm sure people think I'm
> > just a curmudgeonly old turd. ;-}
> >
> Yes, absolutely learn SQL so you understand what's happening under the
> covers, AND then use a framework to abstract much of it away. I cannot
> speak to ActiveRecord, but ORM frameworks like Hibernate in the Java
> world save countless man-hours of work every day, time that can be spent
> on making better applications.

Last time I checked, there isn't an equivalent of Hibernate for PHP. :)

> On Wed, Dec 8, 2010 at 7:14 AM, Tommy Pham <tommy...@gmail.com>
> wrote:
> > The only need I see for this is to build the query dynamically...
> > which should be very rare since all those function calls are
> > expensive, IMO.
> >
> Function calls haven't been expensive since 1992. ;) The cost of running
> SQL query itself will dwarf any function calls made to build the query.
> gains in developer productivity vastly outweigh the small gains to be had
> micro-optimizing away function calls and other abstractions, and developer
> time is much more expensive than CPU time.

Don't know about that since every little bit adds up and with the lower
power consumption aka 'go green', it's hard to say ;)  As for optimizing, it
should have been considered during the application design process before the
code is written.


> Start with code that is easy to understand, write, and debug. Measure the
> performance if it is too slow, find the slow parts using a profiler, and
> optimize them. Nine times out of ten you can gain more by changing your
> algorithm than by removing function calls.
> David

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to