Hacker News new | ask | show | jobs
by fouc 2938 days ago
I was reading this and I was wondering that perhaps it would be better define a line as "80 characters of code", and measure by characters, then divide by 80 to get lines of code.

The whole point of measuring lines of code is to get some sense of the complexity of the code base, but if what if one code base has lots of short lines, and another code base has lots of long lines. How would this be resolved?

3 comments

Number of characters is a meaningless metric because it depends on identifier lengths, which can be very different between coding styles. A much fairer metric would therefor be the number of lexer tokens in my opinion.
Number of "words of code"?
I guess you could call it that.
There would be a bias toward very long identifiers?
Count bytes via wc?