[RkWard-devel] Need some clarification

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Wed Feb 7 12:59:03 UTC 2007


On Tuesday 06 February 2007 18:57, SJR wrote:
> Now Thomas changed it back and defined use global in
> function printout () {} (which obviously makes sense). Actually I do not
> understand why THIS is the way to go. And why doesn't this apply to
> "method"? What do I oversee?

Not much. In this particular case, I had changed the interal value of 
the "use" option for purely technical reasons (I had manually replicated the 
exclusion method for producing the correct matrix of p values). That's why I 
introduced $use as a new variable, and intended to use it in both places.

In general, the consideration is this:
If a variable is needed at more than one place, it is *slightly* more 
efficient to "fetch" it only with getRK[_val], and store it into a PHP 
variable. It's not terribly important to do this, but the more settings there 
are to fetch, the more it may actually make a difference in speed. So there 
is no real need to adjust this in all plugins, but it's something to keep in 
mind when developing complex plugins.

You are right, however, in that whichever method you use, it's best to use it 
consistently, everything else makes the code harder to read, and others will 
wonder "so what's the reason for doing it differently, here". So I've now 
changed it for "method" (and "do_p") as well. But I was just being lazy, 
before, no big mystery.

Regards
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20070207/eb43ade9/attachment.sig>


More information about the Rkward-devel mailing list