Well, that depends. That element might be used for something else,
elsewhere.
If the _intended_ behaviour of the function (and of the array/container)
is documented, then it's relatively easy to make decisions about how
best to implement that, clearly, concisely and efficiently - or at least
to argue it back and forth :)
All too many times, we've gone too far down the wrong rabbit-hole
because we've tried to treat the code as the documentation when the code
doesn't necessarily express what it is actually intended to do.
On 10/10/2010 1:57 PM, Ponzu wrote:
Would it be better to just store FALSE in mRenderTypeEnabled[0]?
On Sat, Oct 9, 2010 at 12:19 PM, Argent <secret.arg...@gmail.com
<mailto:secret.arg...@gmail.com>> wrote:
I don't normally gripe about stuff like this, but somehow this one
triggered my twitches from 20 years of supporting PhD programmers.
Brilliant guys, but sometimes it's SO hard to figure out what they're
trying to do.
This is a case where the trinary "?:" operator is much more readable
and understandable.
(type == 0) ? FALSE : mRenderTypeEnabled[type];
But even better:
if(type == 0)
return FALSE; // explain why here .. eg "in this context we are
always rendering attached prims on the head when blah blah..."
else
return mRenderTypeEnabled[type];
_______________________________________________
Policies and (un)subscribe information available here:
http://wiki.secondlife.com/wiki/OpenSource-Dev
Please read the policies before posting to keep unmoderated
posting privileges
_______________________________________________
Policies and (un)subscribe information available here:
http://wiki.secondlife.com/wiki/OpenSource-Dev
Please read the policies before posting to keep unmoderated posting privileges
--
Tateru Nino
http://dwellonit.taterunino.net/
_______________________________________________
Policies and (un)subscribe information available here:
http://wiki.secondlife.com/wiki/OpenSource-Dev
Please read the policies before posting to keep unmoderated posting privileges