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. stupid question ?

stupid question ?

Scheduled Pinned Locked Moved The Lounge
questionc++designalgorithmstutorial
26 Posts 20 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.
  • Z zoid

    Just wandering what every thinks about this and what the industry expects... How many lines of code should a developer (c/c++) write on average each day ? I know that this is a very general and vague statistic ... Someone designing an algorithm won't write many lines of code ... but will spend a lot of time thinking about how to write them ... Still, I am assuming that the average developer will perform all sorts of programming tasks, algorithm design being one of them. So is there a good number ? :confused: Tom.

    B Offline
    B Offline
    brianwelsch
    wrote on last edited by
    #11

    It's almost like asking how many boards a decent carpenter can nail together in a normal day. It tells you nothing of the quality of what's being constructed. Also, you have to account for the structure of the company. Some programmers are involved through the entire lifecycle of a product, others only test a concept and pass the grunt work on to someone else. Still others are involved in support/training/admin roles and so have less time actually devoted to coding per day. BW The Biggest Loser


    "Farm Donkey makes us laugh.
    Farm Donkey hauls some ass."
    -The Stoves

    Z 1 Reply Last reply
    0
    • B brianwelsch

      It's almost like asking how many boards a decent carpenter can nail together in a normal day. It tells you nothing of the quality of what's being constructed. Also, you have to account for the structure of the company. Some programmers are involved through the entire lifecycle of a product, others only test a concept and pass the grunt work on to someone else. Still others are involved in support/training/admin roles and so have less time actually devoted to coding per day. BW The Biggest Loser


      "Farm Donkey makes us laugh.
      Farm Donkey hauls some ass."
      -The Stoves

      Z Offline
      Z Offline
      zoid
      wrote on last edited by
      #12

      Maybe I should narrow/restate my question a little ... I am well aware that a developer has many different responsibilities ... and that there are different developer positions ... and levels (junior, senior ...etc). By Developer I meaning someone who is dedicated to implementing/coding a specific module or even application. This means he/she already has been given the requirements and some initial conceptual design has been done. What remains to be done is the coding and possibly some mid to lower level design. I am also assuming that the developer is good. By good I mean that he/she follows good coding principles. I.E. readable/efficient/well structured/non-redundant/reuable/etc code. Based on the above I believe that a project of a large enough size will turn out to be similar size if counted in number of lines of code whether it's done by good programmer(s) A or good programmer(s) B. As a result I think that average line count per day can be valid stat... as it is certainly possible that programmer A could finish this project in half the time that B would. Anyways, as I can see from the responses that I have received, this is not a stat that is tracked ... probably because of the difficulties mentioned in the responses ...

      R 1 Reply Last reply
      0
      • Z zoid

        Just wandering what every thinks about this and what the industry expects... How many lines of code should a developer (c/c++) write on average each day ? I know that this is a very general and vague statistic ... Someone designing an algorithm won't write many lines of code ... but will spend a lot of time thinking about how to write them ... Still, I am assuming that the average developer will perform all sorts of programming tasks, algorithm design being one of them. So is there a good number ? :confused: Tom.

        T Offline
        T Offline
        Tim Smith
        wrote on last edited by
        #13

        As per a study 10 years ago: Your average programmer writes 5 lines of debugged and functional code a day. Your best programmers write 100 lines of debugged and functional code a day. Now before everyone goes off and says "I must be GREAT, I write 400 lines of code a day." You really don't. You might write 300 lines one days but you spend the next 4 days working out all the bugs. Then in two months you spend another 4 hours trying to track down a bug in the code. On average, we produce a lot LESS code per day than we think. Tim Smith I'm going to patent thought. I have yet to see any prior art.

        1 Reply Last reply
        0
        • Z zoid

          Just wandering what every thinks about this and what the industry expects... How many lines of code should a developer (c/c++) write on average each day ? I know that this is a very general and vague statistic ... Someone designing an algorithm won't write many lines of code ... but will spend a lot of time thinking about how to write them ... Still, I am assuming that the average developer will perform all sorts of programming tasks, algorithm design being one of them. So is there a good number ? :confused: Tom.

          N Offline
          N Offline
          Nemanja Trifunovic
          wrote on last edited by
          #14

          The real question is: How many problems should a developer solve in a day? Lines of code mean nothing.


          My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.

          1 Reply Last reply
          0
          • Z zoid

            Maybe I should narrow/restate my question a little ... I am well aware that a developer has many different responsibilities ... and that there are different developer positions ... and levels (junior, senior ...etc). By Developer I meaning someone who is dedicated to implementing/coding a specific module or even application. This means he/she already has been given the requirements and some initial conceptual design has been done. What remains to be done is the coding and possibly some mid to lower level design. I am also assuming that the developer is good. By good I mean that he/she follows good coding principles. I.E. readable/efficient/well structured/non-redundant/reuable/etc code. Based on the above I believe that a project of a large enough size will turn out to be similar size if counted in number of lines of code whether it's done by good programmer(s) A or good programmer(s) B. As a result I think that average line count per day can be valid stat... as it is certainly possible that programmer A could finish this project in half the time that B would. Anyways, as I can see from the responses that I have received, this is not a stat that is tracked ... probably because of the difficulties mentioned in the responses ...

            R Offline
            R Offline
            rmorey
            wrote on last edited by
            #15

            ZoiD: You ask an interesting and a somewhat controversial question. From what I recall from a couple of books I've read, the average lines of code per day is indeed somewhere around 10 lines. The number is surprisingly low, but probably accurate, especially for large projects. I was surprised too when I first read it. ZoiD wrote: Based on the above I believe that a project of a large enough size will turn out to be similar size if counted in number of lines of code whether it's done by good programmer(s) A or good programmer(s) B. As a result I think that average line count per day can be valid stat... as it is certainly possible that programmer A could finish this project in half the time that B would. This seems like a perfectly reasonable statement, but it is not accurate. As it turns out, given the exact same specs, two groups of programmers can produce programs of vastly different size. In one study, there was a 5 to 1 difference in the number of lines of code written for functionally equivalent programs. Lines of code is a way of measuring program size, and can only be done after the code is written. There is currently no accurate predictor for predicting the size of a program except to compare it with similar projects written by the same group. Lastly, even if you have a fair estimate of the project size in lines of code, and a reasonably accurate estimate of lines of code per day for each developer, and average that out over the project, there's a good chance you still won't end up with a realistic estimate because the time required to write a program is not a simple linear function. In other words, just because one programmer can write a 400 line program in 4 weeks, does not mean 4 programmers can finish the program in 1 week. There is an excellent book about this exact issue called, "The Mythical Man-Month" by Frederick Brooks. Steve McConnell also has several good books with lots of studies, facts, and background on software development planning, project estimates, etc. I highly recommend "Code Complete" and "Rapid Development".

            1 Reply Last reply
            0
            • Z zoid

              Just wandering what every thinks about this and what the industry expects... How many lines of code should a developer (c/c++) write on average each day ? I know that this is a very general and vague statistic ... Someone designing an algorithm won't write many lines of code ... but will spend a lot of time thinking about how to write them ... Still, I am assuming that the average developer will perform all sorts of programming tasks, algorithm design being one of them. So is there a good number ? :confused: Tom.

              J Offline
              J Offline
              John R Shaw
              wrote on last edited by
              #16

              Late entry! As few lines as possible! Quality is more important than Quantity! Research, Write, Test, Rewrite, Test, Cuss, Research, Rewrite, etc... BELEIVE IT OR NOT: Once upon a time, some programers where paid by the number of lines of code they wrote. Therefor, some other programer had to write a program to count the number of lines of actual code. I still wonder what idiot came up with that idea! INTP

              C 1 Reply Last reply
              0
              • Z zoid

                Just wandering what every thinks about this and what the industry expects... How many lines of code should a developer (c/c++) write on average each day ? I know that this is a very general and vague statistic ... Someone designing an algorithm won't write many lines of code ... but will spend a lot of time thinking about how to write them ... Still, I am assuming that the average developer will perform all sorts of programming tasks, algorithm design being one of them. So is there a good number ? :confused: Tom.

                E Offline
                E Offline
                ElCachubrey
                wrote on last edited by
                #17

                Its depend on speed typing of particular programmer

                1 Reply Last reply
                0
                • P peterchen

                  42? It really depends on the project, and some counting/coding guidelines. When judging "code size", I simply skip lines that have only a curly brace or curly brace and semicolon. I'd never introduce line count as an "evaluated measure". If you do it just for yourself, you should know quite well why you wrote only 12 yesterday, and 4000 today. But as soon as you know that your boss knows yours, the number becomes meaningless. For myself, I'm happier with removing 10 lines, than writing 100.


                  we are here to help each other get through this thing, whatever it is Vonnegut jr.
                  boost your code || Fold With Us! || sighist | doxygen

                  A Offline
                  A Offline
                  Alsvha
                  wrote on last edited by
                  #18

                  peterchen wrote: For myself, I'm happier with removing 10 lines, than writing 100. Only if the functionality improves or stays the same, I'd wager :-D Edit: Seems CP board somehow has placed this reply somewhere wrong --------------------------- 127.0.0.1 - Sweet 127.0.0.1

                  1 Reply Last reply
                  0
                  • J John R Shaw

                    Late entry! As few lines as possible! Quality is more important than Quantity! Research, Write, Test, Rewrite, Test, Cuss, Research, Rewrite, etc... BELEIVE IT OR NOT: Once upon a time, some programers where paid by the number of lines of code they wrote. Therefor, some other programer had to write a program to count the number of lines of actual code. I still wonder what idiot came up with that idea! INTP

                    C Offline
                    C Offline
                    ColinDavies
                    wrote on last edited by
                    #19

                    John R. Shaw wrote: As few lines as possible! Quality is more important than Quantity! AGREED, John R. Shaw wrote: Research, Write, Test, Rewrite, Test, Cuss, Research, Rewrite, etc... whatabout, Research, test research, write ... Typing out code is given too much emphasis, Regardz Colin J Davies Attention: It's finally arrived, The worlds first DSP.

                    1 Reply Last reply
                    0
                    • Z zoid

                      Just wandering what every thinks about this and what the industry expects... How many lines of code should a developer (c/c++) write on average each day ? I know that this is a very general and vague statistic ... Someone designing an algorithm won't write many lines of code ... but will spend a lot of time thinking about how to write them ... Still, I am assuming that the average developer will perform all sorts of programming tasks, algorithm design being one of them. So is there a good number ? :confused: Tom.

                      M Offline
                      M Offline
                      Mike Dimmick
                      wrote on last edited by
                      #20

                      Yesterday, I was debugging a database problem - a timeout occurring when executing a DELETE statement in a batch data update. I needed a representative amount of data so I wrote a data generator. In my coding style, that's 68 lines of non-generated C# code, although some of those lines are blank. I made one mistake which caused it to generate 500,000 records rather than the 50,000 records I needed (which caused the import program to report an overflow!) so I had to change the loop construct, affecting three lines. My immediate solution was to drop two indexes not used by any of the queries which were simply overhead for inserts, updates and deletes. I generated a script using Query Analyzer that worked out at 6 lines. This is a get-you-going fix - the ultimate solution will be to set the CommandTimeout property to something larger than the default of 30 seconds. I spent a long time trying to work out why the same application was reading barcodes of an incorrect length - an application that covers several modules, some of which run on the server and some on a hand-held terminal. I determined that the application module (the server and hand-held software are a product) was setting an incorrect parameter value which allowed any length, rather than just 8 digits. This will be a one-line fix in the application, but the application is scheduled to be rewritten in the near future. A barcode of the wrong length is rejected by the application but it's causing an unnecessary round-trip to the server. When I got home I bowed to the pressure of three users wanting the ToUniversalTime method on the TimeZoneInformation class in my WorldClock[^] application. I wrote an additional 100 non-blank lines in that class (although a number of them are comment lines) and extended the application to allow the user to specify the local time zone (a further 37 lines written by me and 37 generated by the VS.NET designer). Since the underlying function is only available on Windows XP and 2003, I installed Windows 2000 in a VM to test that I'd got the exception handling right, which I hadn't - I'd tried to catch MissingMethodException where I needed to catch EntryPointNotFoundException. I needed to modify 10 lines to get that right and then to report the error cleanly and disable the unsupported options. (Note

                      1 Reply Last reply
                      0
                      • Z zoid

                        Just wandering what every thinks about this and what the industry expects... How many lines of code should a developer (c/c++) write on average each day ? I know that this is a very general and vague statistic ... Someone designing an algorithm won't write many lines of code ... but will spend a lot of time thinking about how to write them ... Still, I am assuming that the average developer will perform all sorts of programming tasks, algorithm design being one of them. So is there a good number ? :confused: Tom.

                        N Offline
                        N Offline
                        Nirav Doshi
                        wrote on last edited by
                        #21

                        ZoiD wrote: How many lines of code should a developer (c/c++) write on average each day ? Our CTO once told us that Motorola has done some internal study and it seems the lines per day of a programmer is about 130 (regardless of the language and logic/algorithm). This is an average calculation for a month's work or so! A similar benchmark is used by some companies for getting to some productivity metrics of their programming team. These lines are supposed to be complete (as per the requirement specs), optimized (no redundant code) & bug-free (as per the requirement specs) lines of code. - Nirav - * Artificial intelligence is no match for natural stupidity! *

                        V 1 Reply Last reply
                        0
                        • Z zoid

                          Just wandering what every thinks about this and what the industry expects... How many lines of code should a developer (c/c++) write on average each day ? I know that this is a very general and vague statistic ... Someone designing an algorithm won't write many lines of code ... but will spend a lot of time thinking about how to write them ... Still, I am assuming that the average developer will perform all sorts of programming tasks, algorithm design being one of them. So is there a good number ? :confused: Tom.

                          A Offline
                          A Offline
                          Andrew Torrance
                          wrote on last edited by
                          #22

                          What is a line of code ? I have in the past produced more in 1 hour than I have in one month. I wrote more working code in the month , but the few well thought out lines I generated in an hour had a much bigger business impact. But perhaps my environment is different to yours . If you have zombies coding to a well defined spec then you are comparing their typing speed , not their thinking speed .

                          1 Reply Last reply
                          0
                          • Z zoid

                            Just wandering what every thinks about this and what the industry expects... How many lines of code should a developer (c/c++) write on average each day ? I know that this is a very general and vague statistic ... Someone designing an algorithm won't write many lines of code ... but will spend a lot of time thinking about how to write them ... Still, I am assuming that the average developer will perform all sorts of programming tasks, algorithm design being one of them. So is there a good number ? :confused: Tom.

                            V Offline
                            V Offline
                            V 0
                            wrote on last edited by
                            #23

                            ZoiD wrote: How many lines of code should a developer (c/c++) write on average each day ? How about code correction, copying and deleting? If I write 10 lines and I delete 2 of them, is it 8 lines or 12??? :-D ZoiD wrote: So is there a good number ? I think it's 534,68 correct? "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix

                            1 Reply Last reply
                            0
                            • N Nirav Doshi

                              ZoiD wrote: How many lines of code should a developer (c/c++) write on average each day ? Our CTO once told us that Motorola has done some internal study and it seems the lines per day of a programmer is about 130 (regardless of the language and logic/algorithm). This is an average calculation for a month's work or so! A similar benchmark is used by some companies for getting to some productivity metrics of their programming team. These lines are supposed to be complete (as per the requirement specs), optimized (no redundant code) & bug-free (as per the requirement specs) lines of code. - Nirav - * Artificial intelligence is no match for natural stupidity! *

                              V Offline
                              V Offline
                              V 0
                              wrote on last edited by
                              #24

                              Nirav Doshi wrote: 130 If I have a bigger number does that mean I'm working overtime :-D??? I should get a raise !! :laugh: "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix

                              1 Reply Last reply
                              0
                              • Z zoid

                                Just wandering what every thinks about this and what the industry expects... How many lines of code should a developer (c/c++) write on average each day ? I know that this is a very general and vague statistic ... Someone designing an algorithm won't write many lines of code ... but will spend a lot of time thinking about how to write them ... Still, I am assuming that the average developer will perform all sorts of programming tasks, algorithm design being one of them. So is there a good number ? :confused: Tom.

                                Z Offline
                                Z Offline
                                zoid
                                wrote on last edited by
                                #25

                                Ok, I see this 'stupid question' seems like it isn't really answerable... The reason I asked is as follows: In an earlier post I mentioned that my company's average was about 10 lines a day... Based on the current project that I am working I calculated that I am writing an **AVERAGE** of 70 lines a day... Based on the discrepency between my output and what I was told the company average was, I was wondering if we need more resources for this project. I know that other developers working on this project are creating a similar average count. I know that as a team we are still slightly behind schedule and definitely behind in documentation, both internal and external... (I am not counting internal docs as lines of code). I wanted to see if the line count could be used as a baseline indicator to show (explain) to management scope of the project and the effort being put in. Thanks for all of your inputs. ps. And yes there are days when I remove 100 lines, but overall the project from start to finish will increase in size so the average line count will always be positive... (unless your position on the team is to inspect other's work)

                                1 Reply Last reply
                                0
                                • Z zoid

                                  Just wandering what every thinks about this and what the industry expects... How many lines of code should a developer (c/c++) write on average each day ? I know that this is a very general and vague statistic ... Someone designing an algorithm won't write many lines of code ... but will spend a lot of time thinking about how to write them ... Still, I am assuming that the average developer will perform all sorts of programming tasks, algorithm design being one of them. So is there a good number ? :confused: Tom.

                                  2 Offline
                                  2 Offline
                                  224917
                                  wrote on last edited by
                                  #26

                                  4 lines in last 16 hrs of work :confused:
                                  There is no spoon. suhredayan

                                  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