Re: ccl

Discussion in 'C Programming' started by HENRY Eshbaugh, Aug 29, 2011.

  1. 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.
    HENRY Eshbaugh, Aug 29, 2011
    #1
    1. Advertising

  2. HENRY Eshbaugh <> 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.
    Ben Bacarisse, Aug 29, 2011
    #2
    1. Advertising

  3. HENRY Eshbaugh

    jacob navia Guest

    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
    jacob navia, Aug 29, 2011
    #3
  4. Again, I fucked up with the reply. Sorry guys.
    HENRY Eshbaugh, Aug 30, 2011
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jacob navia

    New release of the C Containers Library (CCL)

    jacob navia, Oct 30, 2010, in forum: C Programming
    Replies:
    117
    Views:
    1,925
  2. Jon
    Replies:
    16
    Views:
    538
  3. jacob navia

    ccl and stl: design differences

    jacob navia, Apr 17, 2011, in forum: C Programming
    Replies:
    0
    Views:
    183
    jacob navia
    Apr 17, 2011
  4. jacob navia

    CCL vs STL: a comparison

    jacob navia, May 11, 2012, in forum: C Programming
    Replies:
    29
    Views:
    830
    Jens Gustedt
    May 12, 2012
  5. jacob navia

    Updates to the ccl

    jacob navia, Jun 7, 2012, in forum: C Programming
    Replies:
    35
    Views:
    1,003
    Malcolm McLean
    Jul 7, 2012
Loading...

Share This Page