Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Code Metrics

Code Metrics

Scheduled Pinned Locked Moved The Lounge
question
16 Posts 12 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jorgen Sigvardsson
    wrote on last edited by
    #1

    <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!

    P M R M 4 Replies Last reply
    0
    • J Jorgen Sigvardsson

      <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!

      P Offline
      P Offline
      Paul Watson
      wrote on last edited by
      #2

      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?

      N D I P T 6 Replies Last reply
      0
      • J Jorgen Sigvardsson

        <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!

        M Offline
        M Offline
        Michael A Barnhart
        wrote on last edited by
        #3

        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 "

        1 Reply Last reply
        0
        • P Paul Watson

          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?

          N Offline
          N Offline
          Nick Seng
          wrote on last edited by
          #4

          [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

          P 1 Reply Last reply
          0
          • J Jorgen Sigvardsson

            <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!

            R Offline
            R Offline
            RChin
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            • N Nick Seng

              [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

              P Offline
              P Offline
              Paul Watson
              wrote on last edited by
              #6

              [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?

              1 Reply Last reply
              0
              • P Paul Watson

                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?

                D Offline
                D Offline
                David Parrott
                wrote on last edited by
                #7

                Paul Watson wrote: How long is a piece of string. Double half of its length. David Parrott

                1 Reply Last reply
                0
                • P Paul Watson

                  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?

                  I Offline
                  I Offline
                  Ian Darling
                  wrote on last edited by
                  #8

                  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

                  1 Reply Last reply
                  0
                  • J Jorgen Sigvardsson

                    <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!

                    M Offline
                    M Offline
                    Megan Forbes
                    wrote on last edited by
                    #9

                    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

                    1 Reply Last reply
                    0
                    • P Paul Watson

                      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?

                      P Offline
                      P Offline
                      Philip Fitzsimons
                      wrote on last edited by
                      #10

                      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."

                      1 Reply Last reply
                      0
                      • P Paul Watson

                        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?

                        T Offline
                        T Offline
                        Tim Deveaux
                        wrote on last edited by
                        #11

                        Is than an African string or a European string?

                        P T 2 Replies Last reply
                        0
                        • T Tim Deveaux

                          Is than an African string or a European string?

                          P Offline
                          P Offline
                          Paul Watson
                          wrote on last edited by
                          #12

                          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?

                          T 1 Reply Last reply
                          0
                          • T Tim Deveaux

                            Is than an African string or a European string?

                            T Offline
                            T Offline
                            Tomas Petricek
                            wrote on last edited by
                            #13

                            What.. :confused: ? I don't know that !! [Whooooooom !]

                            Tomáš Petříček  :baaaa!: Asp.Net Popup control www.eeeksoft.net

                            T 1 Reply Last reply
                            0
                            • T Tomas Petricek

                              What.. :confused: ? I don't know that !! [Whooooooom !]

                              Tomáš Petříček  :baaaa!: Asp.Net Popup control www.eeeksoft.net

                              T Offline
                              T Offline
                              Tim Deveaux
                              wrote on last edited by
                              #14

                              :-D

                              1 Reply Last reply
                              0
                              • P Paul Watson

                                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?

                                T Offline
                                T Offline
                                Tim Deveaux
                                wrote on last edited by
                                #15

                                :wtf::~

                                1 Reply Last reply
                                0
                                • P Paul Watson

                                  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?

                                  D Offline
                                  D Offline
                                  DRHuff
                                  wrote on last edited by
                                  #16

                                  I always heard that How Long was a Chinaman. Dave Huff In theory there is no difference between theory and practice. In practice there is. (Yogi Berra)

                                  1 Reply Last reply
                                  0
                                  Reply
                                  • Reply as topic
                                  Log in to reply
                                  • Oldest to Newest
                                  • Newest to Oldest
                                  • Most Votes


                                  • Login

                                  • Don't have an account? Register

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular
                                  • World
                                  • Users
                                  • Groups