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

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

Post

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)
"Better" is often a very subjective term. In your case, can you describe what makes one program "bett...
Gharbad The Weak‭ wrote 3 months ago

"Better" is often a very subjective term. In your case, can you describe what makes one program "better" than a different one? Is there something specific about the project you linked that makes you think that it isn't better than the others?

aljustiet‭ wrote 3 months ago

Accuracy. There was said that it uses tokens instead of lines, tree-sitter, etc. I compared it with others; it gave much bigger numbers compared to others.

It was noted in chat that "accuracy" isn't really descriptive, and I agree with that. "Accurately" doesn't really mean anything unless in a context where something can be counted more than once, or something can be missed. Counting tokens instead of lines isn't more accurate, it is something entirely else. There are many things you can count in source code, though. Do you want something that counts as many different things as possible, or something that counts only a very specific thing, and if then, what specific thing are you looking for? Lines? There's only one way to really count lines, and that's newlines. Unless you also want it to exclude empty lines? That's fairly simple. Or do you want to count statements and expressions?

matthewsnyder‭ wrote 3 months ago

I think it's fine to interpret it as "better = answer got most upvotes". The OP sounds like he doesn't know much theory about measuring codebase size, so he is asking for a good metric as much as the name of the program that wins under that metric.

I compared it with others; it gave much bigger numbers compared to others.

Well yes, it would be larger than others by a factor of "number of tokens per line", which is probably around 10.

Andreas witnessed the end of the world today‭ wrote 3 months ago · edited 3 months ago

In that case, the question needs a rather heavy rewrite in the form of «how is code size measured?»