[off topic][advice]

From: invincibill (long@hercules.ntsource.com)
Date: 12/08/96


JTRhone wrote:
snip --->

> >
> See the bug?  If the obj isn't found in the room, you still check obj's
> flags on the else clause.
> 
> I'll make a couple mods to this.  Note: this is not my code, this is code
> that someone posted, and I feel like fixing up a bit.  Also please note,
> that I use an extremely iterative version with something like this.  If
> you are having trouble with some code, it's better not to try to mimic
> some of the gurus on here with squishing up 45 tasks in a small block of
> code.  It's better, if you are not entirely comfortable with C, to split
> up the tasks into a readable format so you actually understand what's goin
> on :)  This is not a flame, merely a suggestion.  BTW, I'm not familiar
> with Circle3.0, since mine is based on 2.2, but I don't recognize the
> object wear flag ITEM_TAKE_WEAR... perhaps its a bit or from two older
> flags, like (ITEM_TAKE | ITEM_WEAR) ?  Just curious :)
> 

this is about the best damn advice i have seen somebody come up with for
all the
semi-C coders out there.  though i love the way C makes it possible to
combine statements and such, for the most part it doesnt make the code
anymore efficient than if you break the statements apart.(for the most
part...no flames please..=]  )
its usually better to "break them apart" for readability.(especially if
you have more than one coder for your mud...or you have some coders that
are not super proficient) not only that, if you split them up, its
easier to insert debugging statements in places to see where actually
the problem is.  then once you get the code right, you might go in and
combine them a little....

just my two cents worth.

invincibill
+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



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