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?
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.
"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?
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?
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.
In that case, the question needs a rather heavy rewrite in the form of «how is code size measured?»
This community is part of the Codidact network. We have other communities too — take a look!
You can also join us in chat!
Want to advertise this community? Use our templates!
Like what we're doing? Support us! Donate
3 comment threads