how many lines of code?

Discussion in 'iPhone/iPad Programming' started by macfanboy, Aug 1, 2008.

  1. macrumors 6502a

    Joined:
    Jun 5, 2007
    #1
    i remember how apple said back in march that touch fighter had 10,000 lines of code (feel free to correct if wrong). how did they come to that conclusion? did they use a utility? sorry if this is a nooob question
     
  2. macrumors 65816

    Joined:
    Apr 19, 2004
    #2
    The IDE tells you how many lines are in your source files. They just added it up.

    The way I've done it in the past is with the command: wc -l *

    Put all your source in a directory, open terminal and cd to that directory. Run that command and it'll output the total number of lines for all files in the directory.
     
  3. macrumors 6502

    Joined:
    Jun 26, 2008
    #3
    Not sure why you're interested as line counts are a very poor measure of complexity.

    For example:

    int i = (somevar == true) ? 15 : 12;

    int i=0;
    if (somevar) {
    i=15;
    }
    else {
    i=12;
    }

    The first is obviously 1 line, the other is 7. Result is the exact same.
     
  4. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #4
    Bragging rights ;)


    17k+ for me :D
     
  5. thread starter macrumors 6502a

    Joined:
    Jun 5, 2007
    #5
    so did u count the lines using terminal? or xcode?
     
  6. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #6
    I just used the wc trick, but obviously that includes whitespace, comments, etc.
     
  7. macrumors 65816

    Joined:
    Apr 19, 2004
    #7
    which makes the trick all the better when having to report to your manager how much lines of code you've written :) managers love this type of crap, especially when they have to report to their managers how productive their team is lol

    another way to estimate is to count the number of semicolons ; because that is the generally the number of statements.

    no one ever really cares what the real number is so don't worry about white space, comments etc. I'm pretty sure that game isn't 10k on the dot.
     
  8. macrumors 68040

    Joined:
    Apr 22, 2005
  9. macrumors newbie

    Joined:
    Feb 16, 2011
    #9
    im 14 and my first usfull app had 12,741 lines of code.
     

Share This Page