Skip to main content
gamedev.net
🔒 Locked

Cpp file size

Started by while1 Feb 24, 2002 at 5:14 AM 12 replies 450+ views
Original Post
while1
while1
How big are your cpp files in genaral? +100, +500 or +1000 lines of code?
Mithrandir
Mithrandir
usually less than 100 lines of actual code.

around 200-300 when you include comments.
This is my signature. There are many like it, but this one is mine. My signature is my best friend. It is my life. I must master it as I must master my life. My signature, without me, is useless. Without my signature, I am useless.
baldurk
baldurk
I normally have about 100 - 200 lines w/o comments however I have a couple of 800 line files. Because of the way I have set up my project they are all header files. I have one cpp file - 388 lines and I have one model file, 2726 lines. But that doesn''t count

------------------------------
Baldur K
Zanthos
Zanthos
For the game i''m doing at the moment, the largest file i''ve got is 2711 lines long(including comments), but it doesn''t get changed. The rest are about.. 300-600 lines(including comments) in length

-= DarkStar =-
jonnyfish
jonnyfish
I usually have one header and one source file per class (interface + implementation), unless there are a few very small classes or structures that closely related to each other. File size will vary with the classes, but well-designed classes shouldn''t be super-mega-huge. I usually try to keep things around 1-2 thousand lines at most (LOTS of whitespace included), and much smaller if possible.
AxoDosS
AxoDosS
The largest cpp file I made was 5105 lines long (about 84 pages whit courier new, size 10).
Senses777
Senses777
My personalised obfuscating string class has an implementation file (.cpp) of 1273 lines. Thats the longest I have.
"I want to make a simple MMORPG first" - Fenryl
bastardos
bastardos

My sprite module includes maybe ~500 lines of (stolen, naturally) code. That''s the record, I think.

-bas
.basprintf ( "And for the %dth time, I'm not American!", ++lIdiots );My homepage
Pouya
Pouya
Was it really necessary to necro this thread after 1.5 years?
Senses777
Senses777
Your so observant Pouya... always the one to notice these things.
"I want to make a simple MMORPG first" - Fenryl
Mithrandir
Mithrandir
I''m like "hey, I''m going to reply to this" and then I see "Mithrandir" and I''m like "WTF!!!"

took me a few seconds... then...


NECRO!
This is my signature. There are many like it, but this one is mine. My signature is my best friend. It is my life. I must master it as I must master my life. My signature, without me, is useless. Without my signature, I am useless.
ShlomiSteinberg
ShlomiSteinberg
Usually 200+ without comments and blank lines, 300+ with comments and blank lines. My biggest header file is around 900 lines without comments and blank lines.

"C lets you shoot yourself in the foot rather easily. C++ allows you to reuse the bullet!"
Member of the Shove Pouya Off A Cliff club, SPOAC. (If you wish to join, add this line to your signature.)Member of "Un-Ban nes8bit" association, UNA (to join put this in your sig)
Crispy
Crispy
file.size = (sizeof(class) || sizeof(group_of_related_functions));
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
Ratman
Ratman
500 lines (including comments) is the breaking point for me. Always try to keep my source files under that size.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.