[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.c

Re: ccl

HENRY Eshbaugh

8/29/2011 2:05:00 PM

The code is pretty good, but the coding style sucks.

Either use ONE CONSISTENT coding style, or don't offer the library in
public. Just looking at some of the source, I'm scared at how
inconsistent it is. You seem to prefer Pascal-case, but then I read
list.c and see this:

static list_element *new_link(Link *li,void *data,const char *fname)

static int DefaultListCompareFunction(const void *left, const void
*right, CompareInfo *ExtraArgs)

static int Clear_nd(List *l)

You have not one, but THREE different ways of naming your functions. I
can't stress the point enough that that _SUCKS_.

My advice on how to fix it: K&R, underscores. That's it.
3 Answers

Ben Bacarisse

8/29/2011 2:47:00 PM

0

HENRY Eshbaugh <henryeshbaugh@gmail.com> writes:

> The code is pretty good, but the coding style sucks.
>
> Either use ONE CONSISTENT coding style, or don't offer the library in
> public.

That's an odd point of view. Why should it not be offered? Do you see
a risk to innocent coders' style from mere the fact that it's visible?
I don't see the harm.

<snip>
> My advice on how to fix it: K&R, underscores. That's it.

That's how I like to write C[1] but it dates me. Almost all the newCode
ISee has gone MixeCase with no separators.

[1] I use Initial_Caps for classes in C++ but I can't ditch the _s even
there.

--
Ben.

jacob navia

8/29/2011 8:21:00 PM

0

Le 29/08/11 16:04, HENRY Eshbaugh a écrit :
> The code is pretty good, but the coding style sucks.
>
> Either use ONE CONSISTENT coding style, or don't offer the library in
> public. Just looking at some of the source, I'm scared at how
> inconsistent it is. You seem to prefer Pascal-case, but then I read
> list.c and see this:
>
> static list_element *new_link(Link *li,void *data,const char *fname)
>
> static int DefaultListCompareFunction(const void *left, const void
> *right, CompareInfo *ExtraArgs)
>
> static int Clear_nd(List *l)
>
> You have not one, but THREE different ways of naming your functions. I
> can't stress the point enough that that _SUCKS_.
>
> My advice on how to fix it: K&R, underscores. That's it.

OK, I will rename the functions with a cobsistent stym, but it is
not that important since all those functions are static, i.e. they
do not belng to the library interface specifications.

Within ALL the exported functions I have consistently named functions
with several words with ALWAYS the first letter capitalized.

The exported functions are important actually. I haven't used a
consistent naming within the static functions.

But you do have a point.

Thanks for the input.

jacob

HENRY Eshbaugh

8/30/2011 4:11:00 AM

0

Again, I fucked up with the reply. Sorry guys.