Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

macfanboy

macrumors 6502a
Original poster
Jun 5, 2007
916
163
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
 
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

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.
 
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.
 
I just used the wc trick, but obviously that includes whitespace, comments, etc.

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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.