|
|
Christopher James Huff <chr### [at] maccom> wrote:
> myCam.Location() = blah;
> is perfectly valid code. Not a good design in most cases, but valid.
Yes.
The problem with that is that returning a non-const reference to a
member variable (which is of course private; if you see a member variable
anywhere else than in the private part, then dump that code, it's crap)
is against good OO coding practices, as it pretty much nullifies the whole
purpose of keeping it in the private part of the class.
Reading and writing to that variable should be done eg. like this:
var = myCam.Location();
myCam.Location(newLocation);
(The reason for this is left as homework... :) )
> And I've never used the "?:" operator.
Why not? It's handy. :)
--
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}// - Warp -
Post a reply to this message
|
|