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. Lines of code...

Lines of code...

Scheduled Pinned Locked Moved The Lounge
c++comquestion
39 Posts 25 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.
  • U Uwe Keim

    You could do it more: Instead of

    if ( a == b )
    cout << a;

    (2 lines) you could do

    if
    (
    a

    b
    )
    {
    cout
    <<
    a
    ;
    }

    12 lines. Thats an improvement of 600 percent (let alone the comments that I've forgotten) :-). -- See me: www.magerquark.de Want a job? www.zeta-software.de/jobs

    A Offline
    A Offline
    Anders Molin
    wrote on last edited by
    #29

    or, to make it really bad...

    i\
    f
    (
    a
    =\

    b
    )
    {
    c\
    o\
    u\
    t
    <\
    <
    a
    ;
    }

    It also makes it nearly impossible to debug :rolleyes: - Anders Money talks, but all mine ever says is "Goodbye!"

    1 Reply Last reply
    0
    • T Tim Smith

      Well, trust me, I didn't take the message as a "Mine is bigger than yours" message. Tim Smith Descartes Systems Sciences, Inc.

      J Offline
      J Offline
      James Pullicino
      wrote on last edited by
      #30

      I hope that we're still talking about lines of code here... :-O (2b || !2b)

      1 Reply Last reply
      0
      • L Le Ridder Noir

        My collegue writes a lot more code than me, so if we were paid for each line should I work like him. >:confused: Some code of him:

        BOOL CMyClass::getDirRoot(char* sDirRootPath)
        {
        BOOL bRet = TRUE;
        CString sDirRootPath_tmp = getenv("Root");
        CString sMsg = "\nRoot = "+ sDirRootPath_tmp;

        #ifdef _DEBUG
        acutPrintf(sMsg);
        #else
        #endif

        if (sDirRootPath\_tmp.GetLength () <= 0)
        {
        	sMsg = "No Root set";
        	AfxMessageBox(sMsg,MB\_OK);
        	bRet = FALSE;
        }
        
        sprintf(sDirRootPath,"%s",sDirRootPath\_tmp);
        return bRet;
        

        }

        BOOL CMyClass::getDirRoot(CString& sDirRootPath)
        {
        BOOL bRet = TRUE;
        CString sDirRootPath_tmp = getenv("Root");
        CString sMsg = "\nRoot = "+ sDirRootPath_tmp;

        #ifdef _DEBUG
        acutPrintf(sMsg);
        #else
        #endif

        if (sDirRootPath\_tmp.GetLength () <= 0)
        {
        	sMsg = "No Root set";
        	AfxMessageBox(sMsg,MB\_OK);
        	bRet = FALSE;
        }
        
        sDirRootPath             = sDirRootPath\_tmp;
        return bRet;
        

        }

        Le Ridder Noir

        Considderd to be the worlds fastest knoppenbonker.
        one year of working experience with the worlds fastest copie paster(about 2000 lines a minute).
        And experience with the one and only NewEra Guru and Crystal Ace.

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

        OK I have to ask it. what is a knoppenbonker? Michael Martin Pegasystems Pty Ltd Australia martm@pegasystems.com +61 413-004-018 "Don't belong. Never join. Think for yourself. Peace" - Victor Stone

        L 1 Reply Last reply
        0
        • T Tim Smith

          Boy, that is really hard to say. But a 1,000,000? Even the best programmers only produce 100 lines of working code a day. (From a study many years ago. The average was 5 lines of working code a day.) That comes out to 26,000 lines of working code a year given 5 days a week, 52 weeks a year. Would take 38 years for the best of us to product 1,000,000 lines of code. Tim Smith Descartes Systems Sciences, Inc.

          P Offline
          P Offline
          peterchen
          wrote on last edited by
          #32

          He was asking for lines of code, not "working lines of code"....

          T 1 Reply Last reply
          0
          • P peterchen

            He was asking for lines of code, not "working lines of code"....

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

            I don't consider 'non-working' lines of code to actually be lines of code. They are lines of garbage. Tim Smith Descartes Systems Sciences, Inc.

            P 1 Reply Last reply
            0
            • L Lost User

              OK I have to ask it. what is a knoppenbonker? Michael Martin Pegasystems Pty Ltd Australia martm@pegasystems.com +61 413-004-018 "Don't belong. Never join. Think for yourself. Peace" - Victor Stone

              L Offline
              L Offline
              Le Ridder Noir
              wrote on last edited by
              #34

              knoppenbonker == key presser **Le Ridder Noir

              Considderd to be the worlds fastest knoppenbonker.
              one year of working experience with the worlds fastest copie paster(about 2000 lines a minute).
              And experience with the one and only NewEra Guru and Crystal Ace.**

              1 Reply Last reply
              0
              • C Christian Graus

                It's my opinion that anyone who produces an average of five lines of code a day deserves to be paid in banana dollars. Christian As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet. Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.

                S Offline
                S Offline
                Steven Mitcham
                wrote on last edited by
                #35

                When you are writing you're own code it's easy to maintain a high level of productivity. However, in the system I'm working on now, I have to insert code into a working system. Since there are sections of the code that no one has looked at in 6 years, It sometimes takes me three or four days of effort to find a one line bug or insert a 20 line enhancement. That's where the low LOC/day figures come from. In addition I am in a CMM Level 3 shop so all of the documentation and procedure documents take a big cut into that. Along with Design and Code Reviews. 20 LOC/day is an awesome spread for me, it usually only happens when I've got a fairly new section of functionality with minimal impacts to the rest of the codebase. When religion and politics help drive the same cart, they tend to drive faster and faster until it is too late to stop when they see the cliff ahead -- Frank Herbert.

                1 Reply Last reply
                0
                • T Tim Smith

                  I don't consider 'non-working' lines of code to actually be lines of code. They are lines of garbage. Tim Smith Descartes Systems Sciences, Inc.

                  P Offline
                  P Offline
                  peterchen
                  wrote on last edited by
                  #36

                  Oh.. I can't follow this view. Otherwise I'd have too many days where hundred lines of code turn into right garbage under my eyes. ;)

                  T 1 Reply Last reply
                  0
                  • P peterchen

                    Oh.. I can't follow this view. Otherwise I'd have too many days where hundred lines of code turn into right garbage under my eyes. ;)

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

                    Yup, it has happened to me WAY too many times. Tim Smith Descartes Systems Sciences, Inc.

                    1 Reply Last reply
                    0
                    • O Oz Solomon

                      How many lines of code have you guys written so far in your life? I'm estimating I've written about 1 million lines :eek:. That might not seem a lot to people who have been at this since the sixties ;) but I still think that its a lot. -Oz --- Grab WndTabs from http://www.wndtabs.com to make your VC++ experience that much more comfortable...

                      T Offline
                      T Offline
                      Todd Smith
                      wrote on last edited by
                      #38

                      There was a post on /. a while back that stated programmers code an average of about 64 days a year. The rest of the time is spent on design, debugging, and canceled projects.

                      1 Reply Last reply
                      0
                      • O Oz Solomon

                        How many lines of code have you guys written so far in your life? I'm estimating I've written about 1 million lines :eek:. That might not seem a lot to people who have been at this since the sixties ;) but I still think that its a lot. -Oz --- Grab WndTabs from http://www.wndtabs.com to make your VC++ experience that much more comfortable...

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

                        I just used the line counting addin to find the number of lines in the project I am working on now. It has 20 VC++ projects and the counted lines of code is 228,000. I am working on this for the past 9 months. The count also includes the VC++ auto-generated code :).

                        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