nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] nanobits3.patch committed


From: Chris Allegretta
Subject: Re: [Nano-devel] nanobits3.patch committed
Date: Thu, 22 Aug 2002 05:11:25 -0700
User-agent: Mutt/1.2.5.1i

On Thu, Aug 22, 2002 at 04:08:34AM -0400, David Benbennick wrote:
> On Wed, Aug 21, 2002 at 09:30:02AM -0700, David Lawrence Ramsey wrote:
> > On Wed, Aug 21, 2002 at 06:50:04AM -0700, Chris Allegretta wrote: 
> > >   ... isn't worth the possibility of confusing
> > >the compiler (I can't imagine making a large portion of the code static
> > >is a good idea).
> 
> I don't understand how static functions can confuse the compiler.  As to
> why declaring local functions "static" is a good idea, I like this answer:
> 
>       "A static function is one that cannot be called anywhere outside
>       of its own file. ... Not declaring a function to be static is
>       like leaving your bike unlocked.  Probably, nothing will go wrong. 
>       But then, after three weeks of everything going great, you get out
>       of class, and your bike is gone.  The difference here is that
>       you're the one stealing the bike...
>                       --- www.stanford.edu/~thehag/Cprog004.pdf page 6

David,

        Okay, now that we have it out in the open, I was not entirely
sure what benefit there was for static functions, so thank you for
explaining it.  That said, I'm not interested in locking down a large
portion of the code like that.  I don't mind if people ride my bike if 
they give it back in the same condition they borrowed it in ;)
        It is definitely a good practice, you have no argument there,
but I'd rather not see a large chunk of the code become static.  C
function defs are hard enough to read as is, especially for my tired old
eyes ;).  A few functions are fine, but IIRC it seemed that we were
having problems with variable assignments from static functions, which
was causing more and more things become statuc.  I don't want that type
of situation.

Okay I have to run, but let me know what you think about this.

Chris A
-- 
Chris Allegretta        http://www.asty.org

"Share and Enjoy" - Douglas Adams, 1952 - 2001




reply via email to

[Prev in Thread] Current Thread [Next in Thread]