Beyond LOC

N

n.torrey.pines

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.
 
?

=?iso-8859-1?q?Erik_Wikstr=F6m?=

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.
 
I

Ian Collins

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?
 
P

peter koch

Ian Collins skrev:
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
 
?

=?iso-8859-1?q?Erik_Wikstr=F6m?=

Ian Collins skrev:


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.
 
I

Ian Collins

peter said:
Ian Collins skrev:



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!
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top