Re[2]: [CODE] Better argument processing

From: Angus Mezick (angus@EDGIL.CCMAIL.COMPUSERVE.COM)
Date: 09/22/97


Ya missed the point, reread my original comment.  Passing by reference is not
bad style, I was saying that changing something that is passed to you is, unless
it is VERY clear that this will happen.  Check out the discussion on what
happens if you alter the contents of argument in a spec that doesn't do anything
and then goes on to run a command.  of course there are exceptions.  I am just
saying, that you HAVE to be very clear as to what is happening.  like how Sam
stated that he was declaring a local buffer, and copying argument into it before
applying his one_arg()
--Angus
______________________________ Reply Separator _________________________________

>Be very careful.  as far as I know, it is bad style for a function to change
the
>contents of a variable of some thing that is passed to it.  I know it happens
>alot, but it is dangerous.  At some point the original value might be needed
>again.
>--Angus

What? Bad style? Passing by refrence is a very commonly used and
sometimes necessary way to get values to functions. I cannot see how
this would be bad style, as passing by value can incurr terrible overhead
therefore reducing the speed and effectiveness of function calls...


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST