Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

What is the most accurate CLOC (count lines of code) program?

+2
−1

I searched for "what is the most accurate lines of code counter linux", but didn't get relevant results. This tcount CLOC project says that it's somehow better than others ones. I don't really believe in this. So I wanted to find out which CLOC program is the most accurate.

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

3 comment threads

The answer will be different depending on which laguage your code is written in. There isn't 1 tool t... (1 comment)
"Better" is often a very subjective term. In your case, can you describe what makes one program "bett... (5 comments)
Suggested rewrite (1 comment)

1 answer

+1
−0

Objectively, the most accurate way would be to actually count the lines. So you would do wc on each file and add them up.

This ends up being not a very useful statistic, because it is sensitive to many trivial things that people who talk about LoC would rather disregard: Blank lines, lines broken for readability, commented lines, duplicated code, dummy files, non-code files.

Usually, what people want to know is something like "how many instructions in this codebase?" because they are trying to understand its complexity, not how many times you pressed the return key. This is probably why tcount claims it's more accurate.

There's another tool called SLOCCount which is made by a researcher who is an expert on measuring code base complexity. There are many others as well if you search for line counters online.

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.

0 comment threads

Sign up to answer this question »