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.

    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