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
visual-studiohelp
20 Posts 13 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Decided to run code metrics on my current "big" VS project. I felt I had a "huge" code base. My 31K of source code (it felt like more) amounted to little more than 7300 lines of "Executable" code. Years ago, I scoffed when I read the average programmer writes only about 100 lines of bug-free code per day.

    "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

    Greg UtasG P D G M 6 Replies Last reply
    0
    • L Lost User

      Decided to run code metrics on my current "big" VS project. I felt I had a "huge" code base. My 31K of source code (it felt like more) amounted to little more than 7300 lines of "Executable" code. Years ago, I scoffed when I read the average programmer writes only about 100 lines of bug-free code per day.

      "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

      Greg UtasG Offline
      Greg UtasG Offline
      Greg Utas
      wrote on last edited by
      #2

      That code must be well commented to get below a 1:4 ratio! I was also surprised when I first heard about the 100 lines per day. Actually, I heard it as 50 to 75, which might be even more accurate.

      Robust Services Core | Software Techniques for Lemmings | Articles
      The fox knows many things, but the hedgehog knows one big thing.

      <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
      <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

      H L G 3 Replies Last reply
      0
      • Greg UtasG Greg Utas

        That code must be well commented to get below a 1:4 ratio! I was also surprised when I first heard about the 100 lines per day. Actually, I heard it as 50 to 75, which might be even more accurate.

        Robust Services Core | Software Techniques for Lemmings | Articles
        The fox knows many things, but the hedgehog knows one big thing.

        H Offline
        H Offline
        honey the codewitch
        wrote on last edited by
        #3

        I know I write more than that.

        To err is human. Fortune favors the monsters.

        N 1 Reply Last reply
        0
        • H honey the codewitch

          I know I write more than that.

          To err is human. Fortune favors the monsters.

          N Offline
          N Offline
          Nelek
          wrote on last edited by
          #4

          You are not average or "normal"

          M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.

          Greg UtasG 1 Reply Last reply
          0
          • L Lost User

            Decided to run code metrics on my current "big" VS project. I felt I had a "huge" code base. My 31K of source code (it felt like more) amounted to little more than 7300 lines of "Executable" code. Years ago, I scoffed when I read the average programmer writes only about 100 lines of bug-free code per day.

            "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

            P Offline
            P Offline
            PIEBALDconsult
            wrote on last edited by
            #5

            "Lines" is not a valid metric for modern languages.

            J L J 3 Replies Last reply
            0
            • P PIEBALDconsult

              "Lines" is not a valid metric for modern languages.

              J Offline
              J Offline
              jmaida
              wrote on last edited by
              #6

              I would not say it is an invalid metric. It's just not an accurate metric. Define modern languages. I can easily write way more than 100 lines of bug free C code a day when deep into a project. My last project was 1.2 megabytes of source code, not including libraries. Not sure how many lines. Maybe I am just a wordy programmer.

              "A little time, a little trouble, your better day" Badfinger

              P 1 Reply Last reply
              0
              • J jmaida

                I would not say it is an invalid metric. It's just not an accurate metric. Define modern languages. I can easily write way more than 100 lines of bug free C code a day when deep into a project. My last project was 1.2 megabytes of source code, not including libraries. Not sure how many lines. Maybe I am just a wordy programmer.

                "A little time, a little trouble, your better day" Badfinger

                P Offline
                P Offline
                PIEBALDconsult
                wrote on last edited by
                #7

                jmaida wrote:

                not an accurate metric.

                Counting statements is more worthwhile than counting "lines". And even then, it depends on what one considers to be a "statement".

                jmaida wrote:

                modern languages

                Any language which doesn't have a 1:1 relationship between a "line" and a statement. I suppose that really only assembly code written on cards had this distinction in the first place. Although "lines" wouldn't apply to card-based systems, but only to VT- and printer-based systems. Even BASIC (Dartmouth, 1964) focuses on statements rather than lines and "line numbers" are primarily for specifying the order in which the statements are to be executed rather than to define a "line of code". And, of course, more modern implementations of BASIC-type languages don't require line numbers at all.

                J 2 Replies Last reply
                0
                • P PIEBALDconsult

                  jmaida wrote:

                  not an accurate metric.

                  Counting statements is more worthwhile than counting "lines". And even then, it depends on what one considers to be a "statement".

                  jmaida wrote:

                  modern languages

                  Any language which doesn't have a 1:1 relationship between a "line" and a statement. I suppose that really only assembly code written on cards had this distinction in the first place. Although "lines" wouldn't apply to card-based systems, but only to VT- and printer-based systems. Even BASIC (Dartmouth, 1964) focuses on statements rather than lines and "line numbers" are primarily for specifying the order in which the statements are to be executed rather than to define a "line of code". And, of course, more modern implementations of BASIC-type languages don't require line numbers at all.

                  J Offline
                  J Offline
                  jmaida
                  wrote on last edited by
                  #8

                  agree

                  "A little time, a little trouble, your better day" Badfinger

                  1 Reply Last reply
                  0
                  • P PIEBALDconsult

                    jmaida wrote:

                    not an accurate metric.

                    Counting statements is more worthwhile than counting "lines". And even then, it depends on what one considers to be a "statement".

                    jmaida wrote:

                    modern languages

                    Any language which doesn't have a 1:1 relationship between a "line" and a statement. I suppose that really only assembly code written on cards had this distinction in the first place. Although "lines" wouldn't apply to card-based systems, but only to VT- and printer-based systems. Even BASIC (Dartmouth, 1964) focuses on statements rather than lines and "line numbers" are primarily for specifying the order in which the statements are to be executed rather than to define a "line of code". And, of course, more modern implementations of BASIC-type languages don't require line numbers at all.

                    J Offline
                    J Offline
                    jmaida
                    wrote on last edited by
                    #9

                    If ending in a ';' is the end of a statement in C. Then counting these may be more accurate than simple a line of code. Fortran is statement oriented so it has a better 1:1 ratio.

                    "A little time, a little trouble, your better day" Badfinger

                    1 Reply Last reply
                    0
                    • P PIEBALDconsult

                      "Lines" is not a valid metric for modern languages.

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #10

                      Visual Studio did the "counting".

                      Quote:

                      Lines of Executable code - Indicates the approximate number of executable code lines or operations. This is a count of number of operations in executable code. This metric is available starting in Visual Studio 2019 version 16.4 and Microsoft.CodeAnalysis.Metrics (2.9.5). The value is typically a close match to the previous metric, Lines of Code, which is the MSIL-instruction-based metric used in legacy mode.

                      "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

                      R 1 Reply Last reply
                      0
                      • N Nelek

                        You are not average or "normal"

                        M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.

                        Greg UtasG Offline
                        Greg UtasG Offline
                        Greg Utas
                        wrote on last edited by
                        #11

                        I find that it varies. Application level, more than that. Framework level can be a different story.

                        Robust Services Core | Software Techniques for Lemmings | Articles
                        The fox knows many things, but the hedgehog knows one big thing.

                        <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
                        <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

                        1 Reply Last reply
                        0
                        • Greg UtasG Greg Utas

                          That code must be well commented to get below a 1:4 ratio! I was also surprised when I first heard about the 100 lines per day. Actually, I heard it as 50 to 75, which might be even more accurate.

                          Robust Services Core | Software Techniques for Lemmings | Articles
                          The fox knows many things, but the hedgehog knows one big thing.

                          L Offline
                          L Offline
                          Lost User
                          wrote on last edited by
                          #12

                          I have a lot of (UWP) XAML; perhaps 25-35%. And don't know if it's considered "executable code" since it's (mostly) declarative; same with simpler properties.

                          "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

                          1 Reply Last reply
                          0
                          • L Lost User

                            Decided to run code metrics on my current "big" VS project. I felt I had a "huge" code base. My 31K of source code (it felt like more) amounted to little more than 7300 lines of "Executable" code. Years ago, I scoffed when I read the average programmer writes only about 100 lines of bug-free code per day.

                            "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

                            D Offline
                            D Offline
                            Derek Hunter
                            wrote on last edited by
                            #13

                            The problem with this is that you can't really decide if it was bug free until years later. If my '100 lines' written today causes someone to spend four days fixing something in two years, then my average drops to 25 lines for that day.

                            1 Reply Last reply
                            0
                            • L Lost User

                              Decided to run code metrics on my current "big" VS project. I felt I had a "huge" code base. My 31K of source code (it felt like more) amounted to little more than 7300 lines of "Executable" code. Years ago, I scoffed when I read the average programmer writes only about 100 lines of bug-free code per day.

                              "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

                              G Offline
                              G Offline
                              GuyThiebaut
                              wrote on last edited by
                              #14

                              Gerry Schmitz wrote:

                              100 lines of bug-free code per day

                              It's not rare that I write 10 lines of code a week - much of my time is spent fixing issues in a huge codebase that has a lot of technical debt in which you spend pretty much all of the time reading or debugging the code.

                              “That which can be asserted without evidence, can be dismissed without evidence.”

                              ― Christopher Hitchens

                              1 Reply Last reply
                              0
                              • L Lost User

                                Decided to run code metrics on my current "big" VS project. I felt I had a "huge" code base. My 31K of source code (it felt like more) amounted to little more than 7300 lines of "Executable" code. Years ago, I scoffed when I read the average programmer writes only about 100 lines of bug-free code per day.

                                "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

                                M Offline
                                M Offline
                                maze3
                                wrote on last edited by
                                #15

                                "writes", does not mean the same as keeps and releases to production, so yeah, 100 per day sounds good

                                1 Reply Last reply
                                0
                                • P PIEBALDconsult

                                  "Lines" is not a valid metric for modern languages.

                                  J Offline
                                  J Offline
                                  JohnDG52
                                  wrote on last edited by
                                  #16

                                  Agreed. Here's five lines of text!

                                  1 Reply Last reply
                                  0
                                  • Greg UtasG Greg Utas

                                    That code must be well commented to get below a 1:4 ratio! I was also surprised when I first heard about the 100 lines per day. Actually, I heard it as 50 to 75, which might be even more accurate.

                                    Robust Services Core | Software Techniques for Lemmings | Articles
                                    The fox knows many things, but the hedgehog knows one big thing.

                                    G Offline
                                    G Offline
                                    gervacleto
                                    wrote on last edited by
                                    #17

                                    My ratio is closer to 1:2 102,436 Lines of Code 60,570 Lines of Executable Accordingly to Visual Studio Metrics. Some day I have written much more than 100 lines/day of code. Actually close to 1000

                                    Greg UtasG 1 Reply Last reply
                                    0
                                    • G gervacleto

                                      My ratio is closer to 1:2 102,436 Lines of Code 60,570 Lines of Executable Accordingly to Visual Studio Metrics. Some day I have written much more than 100 lines/day of code. Actually close to 1000

                                      Greg UtasG Offline
                                      Greg UtasG Offline
                                      Greg Utas
                                      wrote on last edited by
                                      #18

                                      The metric is for released code, meaning that it has been thoroughly tested and integrated.

                                      Robust Services Core | Software Techniques for Lemmings | Articles
                                      The fox knows many things, but the hedgehog knows one big thing.

                                      <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
                                      <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

                                      1 Reply Last reply
                                      0
                                      • L Lost User

                                        Visual Studio did the "counting".

                                        Quote:

                                        Lines of Executable code - Indicates the approximate number of executable code lines or operations. This is a count of number of operations in executable code. This metric is available starting in Visual Studio 2019 version 16.4 and Microsoft.CodeAnalysis.Metrics (2.9.5). The value is typically a close match to the previous metric, Lines of Code, which is the MSIL-instruction-based metric used in legacy mode.

                                        "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

                                        R Offline
                                        R Offline
                                        Ralf Quint
                                        wrote on last edited by
                                        #19

                                        Gerry Schmitz wrote:

                                        Visual Studio did the "counting".

                                        That's your problem, right there... :laugh: :cool:

                                        1 Reply Last reply
                                        0
                                        • L Lost User

                                          Decided to run code metrics on my current "big" VS project. I felt I had a "huge" code base. My 31K of source code (it felt like more) amounted to little more than 7300 lines of "Executable" code. Years ago, I scoffed when I read the average programmer writes only about 100 lines of bug-free code per day.

                                          "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

                                          G Offline
                                          G Offline
                                          Gary Wheeler
                                          wrote on last edited by
                                          #20

                                          I know line count isn't considered a useful metric, but I did one on our current product a while back out of curiosity. The 800-lb gorilla in the room is 2.5 million executable lines.

                                          Software Zen: delete this;

                                          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