Code Metrics
-
<walking-on-thin-ice>Does anyone of you know if there's a "golden ratio" beteen lines of code and lines of comments? Right now I'm at a ratio of 11:1 (code:comment) in a project of ~80 kloc. I believe most of the comments are valid and conveys something meaningful.</walking-on-thin-ice> -- Talk to the hand!
Well back in the good old FORTRAN days it was 1:1 and I feel that was fairly valid for then. You had to document why and where techincial info came from for it. Now if you have no other documentation I would think this is fairly valid. I am talking about engineering type code with lots of references. I hope you have some other documentation though. UML, Visio did not exist in the good ol days :) "Don't be so anti-american, would you? KaЯl (to Paul Watson on Baseball Bats) 26 Nov '03 "
-
How long is a piece of string. regards, Paul Watson Bluegrass South Africa Brian Welsch wrote: "blah blah blah, maybe a potato?" while translating my Afrikaans. Crikey! ain't life grand?
-
<walking-on-thin-ice>Does anyone of you know if there's a "golden ratio" beteen lines of code and lines of comments? Right now I'm at a ratio of 11:1 (code:comment) in a project of ~80 kloc. I believe most of the comments are valid and conveys something meaningful.</walking-on-thin-ice> -- Talk to the hand!
According to my trusty bible of programming development, Code Complete: ..The number of comments, however, will be a side effect of the process itself. Rather than focusing on the number of comments, focus on whether each comment is efficient. If the comments describe why the code was written and meet the other criteria established in this chapter, you'll have enough comments (Code Complete, Chapter 19, Commenting Techniques). All in all, I think the comment-code ratio varies on the situation and complexity that needs to be explained. There are no hard and fast rule, but a little bit of common sense goes a long way.
I Dream of Absolute Zero
-
[Wise Sage Mode]As long as it needs to be, my young grasshopper. As long as it needs to be.[/Wise Sage Mode]
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler. Support Bone
[Tiny glasshopper mode]Exactly, sensei. Same goes for code:comment ratios. As much as it needs to be.[/Tiny glasshopper mode] regards, Paul Watson Bluegrass South Africa Brian Welsch wrote: "blah blah blah, maybe a potato?" while translating my Afrikaans. Crikey! ain't life grand?
-
How long is a piece of string. regards, Paul Watson Bluegrass South Africa Brian Welsch wrote: "blah blah blah, maybe a potato?" while translating my Afrikaans. Crikey! ain't life grand?
Paul Watson wrote: How long is a piece of string. Double half of its length. David Parrott
-
How long is a piece of string. regards, Paul Watson Bluegrass South Africa Brian Welsch wrote: "blah blah blah, maybe a potato?" while translating my Afrikaans. Crikey! ain't life grand?
Paul Watson wrote: How long is a piece of string
strlen("a piece of string");
(or for the VBers):Len("a piece of string")
Duh! :-D -- Ian Darling "The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky -
<walking-on-thin-ice>Does anyone of you know if there's a "golden ratio" beteen lines of code and lines of comments? Right now I'm at a ratio of 11:1 (code:comment) in a project of ~80 kloc. I believe most of the comments are valid and conveys something meaningful.</walking-on-thin-ice> -- Talk to the hand!
So you're looking for the "Golden Mean" of programming then? :-D
Look at the world about you and trust to your own convictions. - Ansel Adams
Meg's World - Blog Photography - The product of my passion -
How long is a piece of string. regards, Paul Watson Bluegrass South Africa Brian Welsch wrote: "blah blah blah, maybe a potato?" while translating my Afrikaans. Crikey! ain't life grand?
twice the length from the middle to the end ;P
"When the only tool you have is a hammer, a sore thumb you will have."
-
How long is a piece of string. regards, Paul Watson Bluegrass South Africa Brian Welsch wrote: "blah blah blah, maybe a potato?" while translating my Afrikaans. Crikey! ain't life grand?
Is than an African string or a European string?
-
Is than an African string or a European string?
In Africa we use stolen copper telephone wire. And it is as long as we can get it. regards, Paul Watson Bluegrass South Africa Brian Welsch wrote: "blah blah blah, maybe a potato?" while translating my Afrikaans. Crikey! ain't life grand?
-
Is than an African string or a European string?
What.. :confused: ? I don't know that !! [Whooooooom !]
Tomáš Petříček :baaaa!: Asp.Net Popup control www.eeeksoft.net
-
What.. :confused: ? I don't know that !! [Whooooooom !]
Tomáš Petříček :baaaa!: Asp.Net Popup control www.eeeksoft.net
:-D
-
In Africa we use stolen copper telephone wire. And it is as long as we can get it. regards, Paul Watson Bluegrass South Africa Brian Welsch wrote: "blah blah blah, maybe a potato?" while translating my Afrikaans. Crikey! ain't life grand?
:wtf::~
-
How long is a piece of string. regards, Paul Watson Bluegrass South Africa Brian Welsch wrote: "blah blah blah, maybe a potato?" while translating my Afrikaans. Crikey! ain't life grand?