[wp-hackers] Re: 2.0.10 and 2.1.3 Release Candidates

Robin Adrianse robin.adr at gmail.com
Sat Mar 17 20:17:10 GMT 2007


Does PHP 4 have support for the static and self keywords?

On 3/17/07, Sabin Iacob <iacobs at m0n5t3r.info> wrote:
>
> Timo Kissing wrote:
> > Instead of one big function I would prefer one (static) class with
> > several (again static) methods, so you would use wp_escape::js($string),
> > wp_escape::url($string) etc. This way all the functions are kept in one
> > place, but it's easy to change one without messing with code that
> > effects the others - and you avoid large if...elseif...else blocks.
>
> ...and you can also have a dispatcher that calls self::whatever, with
> whatever in (js, url, mysql, and so on)
>
> >  WP in my opinion make much more use of OOP anyhow
>
> that's rather modules/namespaces-like functionality than OOP; and it's
> much more useful than OOP in this case, too :)
>
> > (and strictly confirming
> > to a "one class/one function per file" rule would not hurt either, but
> > instead make "messing" with the core and updating later much easier).
> >
>
> one class/namespace/module/whatever != one function; hundreds of files
> with one function each are as hard to maintain as one file with hundreds
> of functions (actually harder, due to having to search for text in
> several files while looking for something, and having to have several
> files open when moving code around);
>
> + 1 for related functions gathered in classes (should I understand that
> a patch doing this would be accepted? :))
> + 1 for one class per file
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list