Dear Open Hub Users,
We’re excited to announce that we will be moving the Open Hub Forum to
https://community.blackduck.com/s/black-duck-open-hub.
Beginning immediately, users can head over,
register,
get technical help and discuss issue pertinent to the Open Hub. Registered users can also subscribe to Open Hub announcements here.
On May 1, 2020, we will be freezing https://www.openhub.net/forums and users will not be able to create new discussions. If you have any questions and concerns, please email us at
info@openhub.net
Hi,
it seems to me that the current version of ohcount only considers comments that are on a separate line without any code. As I often comment at the end of the source line, I get blamed for not putting enough comments into my code :-)
It would be great if a future version would consider mixed code/comment lines. I haven't tried ohcount 2.0 beta, the dependencies scare me too much.
The problem is that you'll get an overcount. I was thinking something similar when writing Ohcount 2.0, but Robin wants our results to return the same number of lines as seen in a text editor.
Our current system drops each line into a category of either comment or code, not both. If we find a line that contains a bit of each, we put it in the code category.
It's not ideal, and we're certainly interested in other ways to measure code.
Some people have recommended that we count characters of code
instead of lines of code
. I'm fine with that -- that would certainly be more precise, and probably a much better way to compute the comment ratio.
I'm not opposed to adding lots of options to the Ohcount tool, to allow people to count code in any way they prefer.
In the near term, though, the Ohloh website itself will probably stick to current functionality until we have some more development time.
One more twist: instead of counting 'characters', we might want to count 'tokens' or 'words' instead - so as to not favor people who like to use reallylongvariable_names.
I'd have to agree with Jason since whitespace is probably the most common character in a given sourcefile. But then that means we'll have to eliminate whitespace when counting comments? Tricky stuff.
@jason: counting words sounds very good. would be the best way i think.