PDA

View Full Version : how many lines of code?




macfanboy
Aug 1, 2008, 03:47 PM
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



psingh01
Aug 1, 2008, 04:19 PM
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.

ayasin
Aug 1, 2008, 09:38 PM
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.

kainjow
Aug 1, 2008, 10:27 PM
Not sure why you're interested as line counts are a very poor measure of complexity.

Bragging rights ;)


17k+ for me :D

macfanboy
Aug 1, 2008, 11:12 PM
Bragging rights ;)


17k+ for me :D

so did u count the lines using terminal? or xcode?

kainjow
Aug 1, 2008, 11:24 PM
so did u count the lines using terminal? or xcode?

I just used the wc trick, but obviously that includes whitespace, comments, etc.

psingh01
Aug 2, 2008, 12:29 AM
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.

admanimal
Aug 2, 2008, 12:49 AM
http://www.folklore.org/StoryView.py?project=Macintosh&story=Negative_2000_Lines_Of_Code.txt&topic=Software%20Design&sortOrder=Sort%20by%20Date&detail=medium

billygiggles
Feb 16, 2011, 06:53 PM
im 14 and my first usfull app had 12,741 lines of code.