[wp-hackers] Coding Standards: Functions vs. Classes

scribu scribu at gmail.com
Sun Mar 18 01:20:35 UTC 2012


>
> Is there some reasoning behind the decision to use a set of functions
> instead
> of a class? Or is it coders choice?
>

The reasoning goes something like this:

1. Use functions.

2. Are there several pieces of data that needs to be constantly passed
around between those functions? Use a class.

And what about static class variables rather than global variables? WP
> stopped supporting PHP4 last year, so is there any reason not to use static
> class variables for new development?
>

I don't think new globals were introduced since we dropped PHP4, but I
haven't see static class variables used yet either.

-- 
http://scribu.net


More information about the wp-hackers mailing list