Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

AndreTheGiant

how many lines in your program?

This topic is 5428 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I frequently hear people talking about writing 1000 lines of code for this project or 10 000 lines for that. First of all, 1000 lines isnt that much is it? I could be wrong, but isnt that just a couple of functions, in maybe 2 or 3 source files? Anyway, Im using vc++ and i have about 30 files in my current project (15 header and 15 cpp approx). Is there an easy way to get vc++ to count all the lines in my project so i know how many lines i wrote? Also, when people say 1000 lines of code, does that include whitespace and really trivial code? Does it include comments? for example,

#include <iostream.h>
#include <fstream>

using namespace std;

int main ( )
{

  // create a read/write file-stream object on tiny char

  // and attach it to the file "filebuf.out"

  ofstream out("filebuf.dat",ios_base::in |ios_base::out);
this is technically 12 lines, but there is only really 1 line of ''actual'' code if you ask me. Would this count as 12, or 1 or something else? If vc++ has a counting functionality, does it cound this as 12 or 1 or something else? thanks!

Share this post


Link to post
Share on other sites
Advertisement
I'd count it as 5...

edit: but as for how people usually count their programs, I usually round down a bit. for instance....

~/Projects/timbirc/src$ cat * | wc -l
4016


I've got a small two thousand line project...


[edited by - C-Junkie on August 9, 2003 4:23:18 PM]

Share this post


Link to post
Share on other sites
I don''t believe there is an official standard about this since it''s not a very useful way to measure code but I''d simply count all lines including comments, whitespaces and preprocessor definitions.

Share this post


Link to post
Share on other sites
Why would you not count "trivial code"?

In my experience, without that "trivial code" your program wouldn''t work

Share this post


Link to post
Share on other sites
http://www.wndtabs.com/ provides a nice little line counting plugin for visual studio 6/7.

Jan Rehders / sheijk. Velox3D programmer at [url=http://www.sechsta-sinn.de]6S[/url]

Share this post


Link to post
Share on other sites
Token count would be much more interesting than line count.

int main() { cout << "hello world" << endl; }

12 tokens

int main()
{
cout << "hello world" << endl;
}

12 tokens

Share this post


Link to post
Share on other sites
token count numbers would be huge for any project

[edited by - psykr on August 10, 2003 5:40:42 PM]

Share this post


Link to post
Share on other sites
Does it really matter? My current project is about 25000 lines at the moment, woohoo, yay for me... *sighs*. It''s the quality of code you write not the quantity.

Death of one is a tragedy, death of a million is just a statistic.

Share this post


Link to post
Share on other sites
No python you fail to realize that you NEED to know the number of lines in your project! What else would you put in your sig besides esoteric metal lyrics?

Share this post


Link to post
Share on other sites
quote:
Original post by python_regious
Does it really matter? My current project is about 25000 lines at the moment, woohoo, yay for me... *sighs*. It''s the quality of code you write not the quantity.


Agreed. That said, I probably would count comments. Comments are an important part of writing code.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!