[development] Advice Needed

Jeff Eaton jeff at viapositiva.net
Tue Aug 28 20:30:02 UTC 2007


This is the classic 'argument for assembly'. C, after all, is just an  
abstraction layer on top of assembly, the efficient native language  
of the microprocessor. It's also the argument against using a CMS. In  
some applications it makes sense. In others, it just makes the  
developer feel 'leet while they scramble around fixing broken queries  
when the client decides that things need to be sorted by number-of- 
weekdays-since-tuesday.

Having helped build a number of remarkably large sites that use Views  
quite heavily, I can say that its queries are just as efficient as  
hand-rolled ones, save the cases where its query building mechanism  
just can't handle certain SQL constructs. (Use of aggregate  
functions, for example).

The benefits of hand-rolled SQL and direct-to-html 15-line PHP  
snippets are certainly compelling. It just needs to be acknowledged  
that on any site of reasonable complexity, that 15-line snippet will  
exist in a hundred different locations, each with minor variations  
and tweaks and hacks and customizations. As will the 'hand-tuned' SQL  
query.

I've found that for sites that need ongoing maintenance or future  
enhancements, the speed penalty for using Views is imaginary and the  
payoff comes in encapsulating those hundred 15-line snippets into a  
single customizable View Style. Underneath the hood, it's nothing but  
a theme function: as complex as YOU want to make it, and nothing more.

--Jeff


On Aug 28, 2007, at 2:55 PM, Bèr Kessels wrote:

> Disclaimer: I am in favour of a simple fifteen-lines PHP function  
> to aggregate
> data from the DB and present that in the table the way the client  
> wants to
> see it, over views, cck, theme-over-theme-over-abstraction layers  
> and all
> that. I just put this other side of the medallion here, so that  
> readers are
> not blinded by all the CCK/views goodness, but can value a simple  
> few lines
> of PHP where appropriate :)


More information about the development mailing list