Beyond LOC

Discussion in 'C++' started by n.torrey.pines@gmail.com, Jan 15, 2007.

  1. Guest

    Is there a program/script for meaningful comparison of C/C++ code
    sizes? I guess what I would consider meaningful is the number of tokens
    (excluding comments but before preprocessing) except brackets, braces
    and commas in function calls and macro applications, or something along
    these lines.

    I googled a bit, but found nothing.
    , Jan 15, 2007
    #1
    1. Advertising

  2. On Jan 16, 12:26 am, wrote:
    > Is there a program/script for meaningful comparison of C/C++ code
    > sizes? I guess what I would consider meaningful is the number of tokens
    > (excluding comments but before preprocessing) except brackets, braces
    > and commas in function calls and macro applications, or something along
    > these lines.
    >
    > I googled a bit, but found nothing.


    This is quite off-topic here, but try googling again for "code metric
    c++" and you might find something. There are many ways to measure code
    and LOC is perhaps one of the least informative, there's something
    called Logical LOC which is more useful if you are interested in
    code-size.

    --
    Erik Wikström
    =?iso-8859-1?q?Erik_Wikstr=F6m?=, Jan 16, 2007
    #2
    1. Advertising

  3. Ian Collins Guest

    wrote:
    > Is there a program/script for meaningful comparison of C/C++ code
    > sizes? I guess what I would consider meaningful is the number of tokens
    > (excluding comments but before preprocessing) except brackets, braces
    > and commas in function calls and macro applications, or something along
    > these lines.
    >

    How would that be meaningful and to whom?

    --
    Ian Collins.
    Ian Collins, Jan 16, 2007
    #3
  4. peter koch Guest

    Ian Collins skrev:
    > wrote:
    > > Is there a program/script for meaningful comparison of C/C++ code
    > > sizes? I guess what I would consider meaningful is the number of tokens
    > > (excluding comments but before preprocessing) except brackets, braces
    > > and commas in function calls and macro applications, or something along
    > > these lines.
    > >

    > How would that be meaningful and to whom?


    It could be meaningful e.g. as part of a code review as it gives you a
    hint as to what functions are complex and thus potential candidates for
    refactoring.

    /Peter
    peter koch, Jan 16, 2007
    #4
  5. On Jan 16, 10:46 am, "peter koch" <> wrote:
    > Ian Collins skrev:
    >
    > > wrote:
    > > > Is there a program/script for meaningful comparison of C/C++ code
    > > > sizes? I guess what I would consider meaningful is the number of tokens
    > > > (excluding comments but before preprocessing) except brackets, braces
    > > > and commas in function calls and macro applications, or something along
    > > > these lines.

    >
    > > How would that be meaningful and to whom?It could be meaningful e.g. as part of a code review as it gives you a

    > hint as to what functions are complex and thus potential candidates for
    > refactoring.


    Google for McCabe, or cyclomatic index or just code metrics in general
    and you'll find that there are quite a number of metrics out there, but
    I don't think yours is one of them.

    --
    Erik Wikström
    =?iso-8859-1?q?Erik_Wikstr=F6m?=, Jan 16, 2007
    #5
  6. Ian Collins Guest

    peter koch wrote:
    > Ian Collins skrev:
    >
    >> wrote:
    >>
    >>>Is there a program/script for meaningful comparison of C/C++ code
    >>>sizes? I guess what I would consider meaningful is the number of tokens
    >>>(excluding comments but before preprocessing) except brackets, braces
    >>>and commas in function calls and macro applications, or something along
    >>>these lines.
    >>>

    >>
    >>How would that be meaningful and to whom?

    >
    >
    > It could be meaningful e.g. as part of a code review as it gives you a
    > hint as to what functions are complex and thus potential candidates for
    > refactoring.
    >

    I have a tool for that, the MK1 eyeball!

    --
    Ian Collins.
    Ian Collins, Jan 16, 2007
    #6
    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. Marcelo Birnbach [MS]
    Replies:
    0
    Views:
    3,305
    Marcelo Birnbach [MS]
    Jun 28, 2003
  2. fpgawizz

    not able to write to addr loc x0

    fpgawizz, Apr 2, 2005, in forum: VHDL
    Replies:
    1
    Views:
    426
    info_
    Apr 2, 2005
  3. El Durango

    Eclipse question regarding LOC.

    El Durango, Jul 19, 2004, in forum: Java
    Replies:
    4
    Views:
    25,936
    James
    Jul 20, 2004
  4. Adriaan Renting

    LOC in Python and C++ in large projects

    Adriaan Renting, Jul 1, 2005, in forum: Python
    Replies:
    1
    Views:
    1,963
    Mike Meyer
    Jul 1, 2005
  5. Replies:
    2
    Views:
    471
Loading...

Share This Page