[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Ayttm-devel] Function prototypes in .c files
From: |
Andy |
Subject: |
Re: [Ayttm-devel] Function prototypes in .c files |
Date: |
Tue, 21 Jan 2003 23:22:03 -0100 |
User-agent: |
KMail/1.4.3 |
On Tuesday 21 January 2003 20:29, Colin Leroy wrote:
> On Tue, 21 Jan 2003 20:50:46 -0100 Andy <address@hidden> wrote:
[snip]
> > I think naming in general needs to be discussed. For example, how do I
> > know that a variable called filename is global? My preference is to use
> > gFileName if it's truly a global and sFileName if it's a .c file static
> > global, but any way of indicating that we're dealing with a global is
> > again a huge help for the developer when modifying something.
>
> Global vars should be avoided anyway (there aren't much, only the minimum
> we really _need_ afaik). The best would be to have them static and
> accessed through a (public) function.
I agree with that.
> sFileName gFileName and such are horrible to type, too. I need to press
I don't agree with that :-)
> three time on shift to type it, that's quite awful at end of a coding day
> (I code 12 hours/day so it counts at end of day)
> etags helps much more than naming to know what we refer too than
What's an etag?
> hard-to-keep naming conventions.
What's so hard to keep about naming conventions? All it requires is a little
discipline. In my code I can look at any variable anywhere and tell
instantly whether it's a global [not many!], a parameter [input, output, or
both], or a local. That's a huge advantage when 'new eyes' are looking at
the code.
Andy