[EMAIL PROTECTED] (Chris Waterson) writes:
>> *Check for errors early and often. Every time you make a call into an
>> XPCOM function, you should check for an error condition. You need to
>> do this even if you know that call will never fail.
>
>Okay, I'm gonna draw a line in the sand and claim that this is way too
>facist. Why? Because you know and I know that we over-use COM in an
>obnoxious way. I think that judgement needs to be exercised here.
>
>> *Return from errors immediately Every time an error condition
>> happens, your knee-jerk reaction should be to return from the current
>> function.
>
>See above. Use judgement when propagating errors to the caller.

        While I agree some judgement it needed, just because a call can't
fail now, doesn't mean it won't suddenly start failing two weeks from
now when someone rips the guts out of the nsTwiddleThumbs service.

        I've run across a number of crashing bugs (including one today)
that didn't check COM results and crashed.  So use judgement, but add at
least a modicum of paranoia to it.  (And this has little directly to do
with COM.)

>> Naming and Formatting code
>> 
>
>But, above all, FOLLOW LOCAL CONVENTION! Your job is not to proselytize
>Your Favorite Style. Your job is to make it easier on the next person
>that has to work on the mess.

        Also, the more non-functional formatting changes checked in, the
less useful LXR, cvs diff, etc are.

-- 
Randell Jesup, Worldgate Communications, ex-Scala, ex-Amiga OS team ('88-94)
[EMAIL PROTECTED]

Reply via email to