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. how long would it take to write a MB of code

how long would it take to write a MB of code

Scheduled Pinned Locked Moved The Lounge
c++question
23 Posts 14 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.
  • M Munchies_Matt

    C++ say. I was just looking at the product I am working on and in total it has almost 1.2 GB of data in the project directories (after cleaning) HOw long would it take one programmer to write that much code?

    OriginalGriffO Online
    OriginalGriffO Online
    OriginalGriff
    wrote on last edited by
    #2

    Couple of minutes.

    using System.Collections.Generic;
    using System.IO;

    namespace GeneralTesting
    {
    class MakeCode
    {
    public static void main()
    {
    List lines = new List();
    lines.Add("using System.Collections.Generic;");
    lines.Add("using System.IO;");
    lines.Add("");
    lines.Add("namespace GeneralTesting");
    lines.Add(" {");
    lines.Add(" class MakeCode");
    lines.Add(" {");
    lines.Add(" public static void main()");
    lines.Add(" {");
    for (int i = 0; i < 1000000; i++)
    {
    lines.Add(" Console.WriteLine(\"" + i.ToString() + "\");");
    }
    lines.Add(" File.WriteAllLines(@\"D:\\Temp\\MyCode.cs\", lines);");
    lines.Add(" }");
    lines.Add(" }");
    lines.Add(" }");

            File.WriteAllLines(@"D:\\Temp\\MyCode.cs", lines);
            }
        }
    }
    

    Run that, problem solved.

    Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!

    "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
    "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

    L 1 Reply Last reply
    0
    • OriginalGriffO OriginalGriff

      Couple of minutes.

      using System.Collections.Generic;
      using System.IO;

      namespace GeneralTesting
      {
      class MakeCode
      {
      public static void main()
      {
      List lines = new List();
      lines.Add("using System.Collections.Generic;");
      lines.Add("using System.IO;");
      lines.Add("");
      lines.Add("namespace GeneralTesting");
      lines.Add(" {");
      lines.Add(" class MakeCode");
      lines.Add(" {");
      lines.Add(" public static void main()");
      lines.Add(" {");
      for (int i = 0; i < 1000000; i++)
      {
      lines.Add(" Console.WriteLine(\"" + i.ToString() + "\");");
      }
      lines.Add(" File.WriteAllLines(@\"D:\\Temp\\MyCode.cs\", lines);");
      lines.Add(" }");
      lines.Add(" }");
      lines.Add(" }");

              File.WriteAllLines(@"D:\\Temp\\MyCode.cs", lines);
              }
          }
      }
      

      Run that, problem solved.

      Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!

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

      OriginalGriff wrote:

      Couple of minutes.

      couple of minutes! slow machine?

      This internet thing is amazing! Letting people use it: worst idea ever!

      F OriginalGriffO D 3 Replies Last reply
      0
      • L Lost User

        OriginalGriff wrote:

        Couple of minutes.

        couple of minutes! slow machine?

        This internet thing is amazing! Letting people use it: worst idea ever!

        F Offline
        F Offline
        Forogar
        wrote on last edited by
        #4

        Quote:

        slow machine?

        Slow typist.

        - I would love to change the world, but they won’t give me the source code.

        1 Reply Last reply
        0
        • M Munchies_Matt

          C++ say. I was just looking at the product I am working on and in total it has almost 1.2 GB of data in the project directories (after cleaning) HOw long would it take one programmer to write that much code?

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

          Did you exclude resources like bitmaps, icons, and such? How about static data files? Help and other documentation? If you exclude that, my team's current product occupies about 100MB in source code. If you add that data in, it's almost 6GB, most of which is static data.

          Software Zen: delete this;

          M 1 Reply Last reply
          0
          • L Lost User

            OriginalGriff wrote:

            Couple of minutes.

            couple of minutes! slow machine?

            This internet thing is amazing! Letting people use it: worst idea ever!

            OriginalGriffO Online
            OriginalGriffO Online
            OriginalGriff
            wrote on last edited by
            #6

            I had to write the code to generate that, test it, and then post it up to CP ... and field Herself at the same time.

            Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!

            "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
            "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

            1 Reply Last reply
            0
            • M Munchies_Matt

              C++ say. I was just looking at the product I am working on and in total it has almost 1.2 GB of data in the project directories (after cleaning) HOw long would it take one programmer to write that much code?

              D Offline
              D Offline
              dandy72
              wrote on last edited by
              #7

              Would you include code that's been deleted? Over time, you can refactor/remove a lot of code that's no longer part of a given project's current codebase. If you factor in the amount of time spent on code that's no longer there, that can easily skew whatever numbers you're looking for. I'd have to think something like Github has to have tools that let you track things like that and then run queries against it in various ways. I can tell you based on my own usage of TFS that it would provide zero insight into that sort of thing.

              1 Reply Last reply
              0
              • M Munchies_Matt

                C++ say. I was just looking at the product I am working on and in total it has almost 1.2 GB of data in the project directories (after cleaning) HOw long would it take one programmer to write that much code?

                R Offline
                R Offline
                raddevus
                wrote on last edited by
                #8

                There are 86,400 seconds in one day. So, if the dev typed one character (of code) / sec then it would take more than 13,888 days to type 1.2 GB of code. 13,888 days = 38 years. Of course, that is typing constantly for 38 years straight without doing anything else. :rolleyes: EDIT Oh, you said 1 MB. Well... About 11.5 days of solid typing. :laugh:

                S G 2 Replies Last reply
                0
                • L Lost User

                  OriginalGriff wrote:

                  Couple of minutes.

                  couple of minutes! slow machine?

                  This internet thing is amazing! Letting people use it: worst idea ever!

                  D Offline
                  D Offline
                  Dirk Bahle
                  wrote on last edited by
                  #9

                  Give the man a minute or two to write the code ...

                  1 Reply Last reply
                  0
                  • M Munchies_Matt

                    C++ say. I was just looking at the product I am working on and in total it has almost 1.2 GB of data in the project directories (after cleaning) HOw long would it take one programmer to write that much code?

                    T Offline
                    T Offline
                    theoldfool
                    wrote on last edited by
                    #10

                    Easy, go to QA and ask for the codez

                    If you can keep your head while those about you are losing theirs, perhaps you don't understand the situation.

                    1 Reply Last reply
                    0
                    • R raddevus

                      There are 86,400 seconds in one day. So, if the dev typed one character (of code) / sec then it would take more than 13,888 days to type 1.2 GB of code. 13,888 days = 38 years. Of course, that is typing constantly for 38 years straight without doing anything else. :rolleyes: EDIT Oh, you said 1 MB. Well... About 11.5 days of solid typing. :laugh:

                      S Offline
                      S Offline
                      SirWernich
                      wrote on last edited by
                      #11

                      don't forget about indentation. now we can fight about whether we should use superior tabs or inferior spaces.

                      D 1 Reply Last reply
                      0
                      • S SirWernich

                        don't forget about indentation. now we can fight about whether we should use superior tabs or inferior spaces.

                        D Offline
                        D Offline
                        Dar Brett 0
                        wrote on last edited by
                        #12

                        Easy decision... Tabs: 1 byte Spaces: 8 bytes Clearly you want to use spaces.

                        L 1 Reply Last reply
                        0
                        • D Dar Brett 0

                          Easy decision... Tabs: 1 byte Spaces: 8 bytes Clearly you want to use spaces.

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

                          Dar Brett wrote:

                          Easy decision... Tabs: 1 byte Spaces: 8 bytes Clearly you want to use spaces.

                          The Maunder does. He may hit the tab key, but it is stored as spaces not a tab.

                          Michael Martin Australia "I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible." - Mr.Prakash One Fine Saturday. 24/04/2004

                          1 Reply Last reply
                          0
                          • G Gary Wheeler

                            Did you exclude resources like bitmaps, icons, and such? How about static data files? Help and other documentation? If you exclude that, my team's current product occupies about 100MB in source code. If you add that data in, it's almost 6GB, most of which is static data.

                            Software Zen: delete this;

                            M Offline
                            M Offline
                            Munchies_Matt
                            wrote on last edited by
                            #14

                            No static data, but there are icons, resource files, which are still hand crafted, so it's OK to include them. So yeah, 10 GB of code. It is huge.

                            B 1 Reply Last reply
                            0
                            • M Munchies_Matt

                              C++ say. I was just looking at the product I am working on and in total it has almost 1.2 GB of data in the project directories (after cleaning) HOw long would it take one programmer to write that much code?

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

                              Along with the images and static stuff, is auto complete and higher level language compiling. Stub classes might be as quick as 2 or 3 key presses making 20+ characters. then add in simply press // + tab to generate another 20+ characters of method documentation stub. Use entity framework, and simply generate mvc web page with read/write adds some 300+ characters. But in contrast, if write in TypeScript and Less, might take longer to hit 1mb compared to writing it out in pure JS. even jquery shortens number of characters needed to accomplish the same thing in pure js.

                              M 1 Reply Last reply
                              0
                              • M maze3

                                Along with the images and static stuff, is auto complete and higher level language compiling. Stub classes might be as quick as 2 or 3 key presses making 20+ characters. then add in simply press // + tab to generate another 20+ characters of method documentation stub. Use entity framework, and simply generate mvc web page with read/write adds some 300+ characters. But in contrast, if write in TypeScript and Less, might take longer to hit 1mb compared to writing it out in pure JS. even jquery shortens number of characters needed to accomplish the same thing in pure js.

                                M Offline
                                M Offline
                                Munchies_Matt
                                wrote on last edited by
                                #16

                                Most of this is straight off svn, so no autocomplete databases yet built. The two I have worked on I cleaned and deleted these databases so this really is the code size. Seriously, it is immense.

                                1 Reply Last reply
                                0
                                • M Munchies_Matt

                                  C++ say. I was just looking at the product I am working on and in total it has almost 1.2 GB of data in the project directories (after cleaning) HOw long would it take one programmer to write that much code?

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

                                  Munchies_Matt wrote:

                                  HOw long would it take one programmer to write that much code?

                                  It depends on third party products and how many spaguetti code from the internet he had copied

                                  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.

                                  1 Reply Last reply
                                  0
                                  • R raddevus

                                    There are 86,400 seconds in one day. So, if the dev typed one character (of code) / sec then it would take more than 13,888 days to type 1.2 GB of code. 13,888 days = 38 years. Of course, that is typing constantly for 38 years straight without doing anything else. :rolleyes: EDIT Oh, you said 1 MB. Well... About 11.5 days of solid typing. :laugh:

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

                                    Pshaw. One character per second? That's really slow for typing speed. **<BullshitWarning>** Let's use my 80 year-old mother as a test subject here. She's a classically-trained touch typist, with a measured typing speed at one time of around 90 words per minute. Based on A Note on Calculating Text Entry Speed[^], that corresponds to (90 * 5) / 60 = 7.5 characters per second. 1.2GB of source code should therefore require only 5.45 years. Note that this result is based on Mom's typing speed measured on a mechanical typewriter keyboard. I don't have data, but it's reasonable to assume she would be faster on a modern electronic keyboard. She bought a refurbished IBM Selectric[^] typewriter when I was in high school, and I remember her claiming her typing speed increased substantially. Let's take a W.A.G. here and assume that an electronic keyboard gives you a speed edge of 25%, which then reduces the time for 1.2GB of code to 4.36 years. All of that is mere mechanics, however. Source code editors provide all kinds of productivity aids: text templates and snippets, predictive typing (IntelliSense), and so on. After I'd been using C# for a while, I found I'd modified my code editing habits to really take advantage of Visual Studio's predictive typing features. I wouldn't be surprised to be able to generate 1.2GB of source code in less than a year. **</BullshitWarning>**

                                    Software Zen: delete this;

                                    R 1 Reply Last reply
                                    0
                                    • G Gary Wheeler

                                      Pshaw. One character per second? That's really slow for typing speed. **<BullshitWarning>** Let's use my 80 year-old mother as a test subject here. She's a classically-trained touch typist, with a measured typing speed at one time of around 90 words per minute. Based on A Note on Calculating Text Entry Speed[^], that corresponds to (90 * 5) / 60 = 7.5 characters per second. 1.2GB of source code should therefore require only 5.45 years. Note that this result is based on Mom's typing speed measured on a mechanical typewriter keyboard. I don't have data, but it's reasonable to assume she would be faster on a modern electronic keyboard. She bought a refurbished IBM Selectric[^] typewriter when I was in high school, and I remember her claiming her typing speed increased substantially. Let's take a W.A.G. here and assume that an electronic keyboard gives you a speed edge of 25%, which then reduces the time for 1.2GB of code to 4.36 years. All of that is mere mechanics, however. Source code editors provide all kinds of productivity aids: text templates and snippets, predictive typing (IntelliSense), and so on. After I'd been using C# for a while, I found I'd modified my code editing habits to really take advantage of Visual Studio's predictive typing features. I wouldn't be surprised to be able to generate 1.2GB of source code in less than a year. **</BullshitWarning>**

                                      Software Zen: delete this;

                                      R Offline
                                      R Offline
                                      raddevus
                                      wrote on last edited by
                                      #19

                                      That is hilarious and an interesting way to look at code...that you type it and don't even think about what you are typing. :laugh: I set the 1 character/second rate (60 chars/minute) to account for the dev actually thinking about the code s/he is typing. But, you are correct, we know that devs don't actually think. They just type. :rolleyes:

                                      G 1 Reply Last reply
                                      0
                                      • R raddevus

                                        That is hilarious and an interesting way to look at code...that you type it and don't even think about what you are typing. :laugh: I set the 1 character/second rate (60 chars/minute) to account for the dev actually thinking about the code s/he is typing. But, you are correct, we know that devs don't actually think. They just type. :rolleyes:

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

                                        raddevus wrote:

                                        That is hilarious and an interesting way to look at code...that you type it and don't even think about what you are typing

                                        Thanks :-D. Most programmers understand the flow experience[^], where the code you're writing seems to come out of your fingers without a lot of thought. With the productivity aids I mentioned, and enabling the flow as much as possible, it's intuitive that you would get peak rates of source code generation some significant multiple of your non-flow rate. Irrelevant side note: I get migraine headaches. One of my precursor symptoms is emotional swings, like a rollercoaster version of manic-depression. I've written some really interesting, large chunks of code in a pre-migraine manic state. Some times it actually worked :sigh:.

                                        raddevus wrote:

                                        we know that devs don't actually think. They just type

                                        10 GET "https://www.codeproject.com/Questions/ask.aspx","_programming task_"
                                        20 GOSUB 1000 'copy
                                        30 GOSUB 2000 'paste
                                        40 GOTO 10

                                        Software Zen: delete this;

                                        1 Reply Last reply
                                        0
                                        • M Munchies_Matt

                                          No static data, but there are icons, resource files, which are still hand crafted, so it's OK to include them. So yeah, 10 GB of code. It is huge.

                                          B Offline
                                          B Offline
                                          Brady Kelly
                                          wrote on last edited by
                                          #21

                                          What about packages, e.g. NuGet?

                                          "'Do what thou wilt...' is to bid Stars to shine, Vines to bear grapes, Water to seek its level; man is the only being in Nature that has striven to set himself at odds with himself." —Aleister Crowley

                                          M 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