PDA

View Full Version : What's the Biggest Program You have ever Written?



Davros
11-28-2004, 10:34 AM
What's the Biggest (one man) Program You have ever Written?

Here's a quick poll.

Lurker
11-28-2004, 10:40 AM
Divide that by about ..... 75,000.

Thantos
11-28-2004, 10:43 AM
Lines of code does not always reflect the complexity of a program. A program written by a new programmer is likely to be longer in source code then the same program written by an experienced programmer. Also are you counting lines of comments and blank lines?

Davros
11-28-2004, 10:45 AM
>Also are you counting lines of comments

Let's say include comments, but not blank lines. I am not expecting precise answers.

Zach L.
11-28-2004, 10:45 AM
True... However, how many new programmers get to 75,000 lines and can still have it compile. ;)

Prelude
11-28-2004, 10:56 AM
>how many new programmers get to 75,000 lines and can still have it compile.


/* prog.c */
#include <stdio.h>

int main ( void )
{
FILE *out = fopen ( "silly.c", "w" );
long i;

for ( i = 0; i < 75000; i++ )
fprintf ( out, "/* I am silly */\n" );

fclose ( out );

return 0;
}



$ gcc prog.c
$ ./a.out
$ gcc silly.c

Looks pretty easy to me.

Brain Cell
11-28-2004, 11:25 AM
ROFL @ Prelude

I think we shouldn't count comments :p

my longest program wouldn't go over 500 lines.

axon
11-28-2004, 01:00 PM
didn't read the whole post before voting...so my longest was about 5K w/out comments. Now that I think about it comments really don't matter in this poll - the divisions are too great.

XSquared
11-28-2004, 01:03 PM
My biggest program was about 200k lines (don't remember if we included comments in that # or not).

jverkoey
11-28-2004, 01:48 PM
durr... I lied in my vote, I thought OST2 was 10k lines, but I guess it's 33K, lol (20K of effective).

But yah, OST2's definitely my biggest project out of anything.

Brain Cell
11-28-2004, 02:04 PM
how do you guys write programs with 1k of lines? do you test\debug it in small chunks (seperate programs) or go through the code all over again to fix your errors?

Prelude
11-28-2004, 02:23 PM
>how do you guys write programs with 1k of lines?
We start at the top and go down, making things up as they come to us. When we get to the bottom, we compile and hope like hell that it works. If it doesn't, we repeat the process until it does. This is called incremental development. For each build, we get that much closer to a working application by applying what we learned from the last build.

jverkoey
11-28-2004, 02:30 PM
Also, the bigger the program is, the more you should generally split your code in to different files. I'm not sure if this is how it's done professionally but whenever I make a new class, I make a new cpp/h pair for that class that, if I wanted to, could be stripped out of the program and popped in to another one very easily. Right now, whenever I make some code that is very useful, I shell it out of the program and pop it in to my "Library" which is just a folder of code, and then all my projects point to that source, so when I find a bug in one program, all other programs using that library get fixed....

*stops blabbing*

But anyway, the way I make programs that have >1k lines is to just start off with the basics and build on from there till I've got my finished product (like Prelude said, for the most part :rolleyes: )

axon
11-28-2004, 02:33 PM
>how do you guys write programs with 1k of lines?
We start at the top and go down, making things up as they come to us. When we get to the bottom, we compile and hope like hell that it works. If it doesn't, we repeat the process until it does. This is called incremental development. For each build, we get that much closer to a working application by applying what we learned from the last build.

I think he was asking a legitimate question and got a sarcastic answer....just look at the sig. Not all beginner questions need an over the top bashing reply.

Anyways, Brain Cell, programs with a lot of code are very rarely one monolithic file - they are broken into small pieces that work well together (ideally). When I write any program (no matter how small or big) I compile, run, and debug it periodically to check my logic (Its much easier to find a bug in 25 lines of code than 500 ;) ). It is good to acquire this habit early in your programming career as it will be very helpful later on.

Prelude
11-28-2004, 02:43 PM
>I think he was asking a legitimate question
I think so too, but with the options given, you would think that common sense could give a reasonable answer. ;)

>got a sarcastic answer....
Tact is for people who aren't witty enough to be sarcastic. :p

>Not all beginner questions need an over the top bashing reply.
I prefer subtle bashing to over the top bashing. That way we have at least a nice range of bashers with quzah being over the top, Salem taking the middle ground, and me with something subtle and ambiguous. It's also convenient that each of us can slip into a different role so that the victim doesn't get too much of a good thing and run away screaming.

>do you test\debug it in small chunks
Yes.

>or go through the code all over again to fix your errors?
Only in very tiny scratch and toss programs.

Brain Cell
11-28-2004, 02:44 PM
I think he was asking a legitimate question and got a sarcastic answer....just look at the sig. Not all beginner questions need an over the top bashing reply.
I don't know if he was born a good programmer , but i do know that im a regular guy trying to learn new stuff every day :).


Anyways, Brain Cell, programs with a lot of code are very rarely one monolithic file - they are broken into small pieces that work well together (ideally). When I write any program (no matter how small or big) I compile, run, and debug it periodically to check my logic (Its much easier to find a bug in 25 lines of code than 500 ;) ). It is good to acquire this habit early in your programming career as it will be very helpful later on.
Well i've been programming in C for a while but i've never had to write big programmer thats why im asking.

Thanks for sharing that axon :)

axon
11-28-2004, 02:45 PM
>>if HE was

she :p

Brain Cell
11-28-2004, 02:49 PM
well she :p

and i always thought Prelude was a guy... :rolleyes:

gcn_zelda
11-28-2004, 03:00 PM
Even with the female avatar? :P

Don't worry about it. I always thought Govtcheez was a girl.

Prelude
11-28-2004, 03:08 PM
>I don't know if he was born a good programmer
I was born a really really REALLY bad programmer. My programs were ugly incarnate. :D Fortunately, I recovered, though I believe I ended up overcompensating and moving to the other extreme. :p

gcn_zelda
11-28-2004, 03:10 PM
So your programs are unbelievably sexy now?

Darkness
11-28-2004, 03:13 PM
If I 'program' 10,000 different people's TiVOs to record something, and each 'programming session' would generate the equivalent of a line of code, does that mean I've written a single 10k line program?

Otherwise I'm writing a physics modeling program that is several K long

Prelude
11-28-2004, 03:14 PM
>So your programs are unbelievably sexy now?
I write my programs with concentrated sexy, 180 proof.

gcn_zelda
11-28-2004, 03:16 PM
Could I buy some of that stuff off you?

It might be useful outside of programming, too.

okinrus
11-28-2004, 04:18 PM
how do you guys write programs with 1k of lines? do you test\debug it in small chunks (seperate programs) or go through the code all over again to fix your errors?

You can try reading books like Object-Oriented Analysis and Design with applications by Gary Booch. A free UML tool can be found at http://www.htc.honeywell.com/dome/ Once I write what the program is supposed to do, the scenarios, I try to write diagrams of design of the program from most general subsystem relations to class methods. Then I'll write about 500 lines(about 4 related classes) and then write tests. ( You might want to try writing the tests before writing the classes might be better. But at least have a general idea of how you want to test the class at design time--you don't get stuck with untestable classes :)). You should be able to easily write programs with more 15K lines of code. More than that, you'll want to try a more formal method.

Thantos
11-28-2004, 07:19 PM
Thank you Prelude, that line is going into my sig!

Zach L.
11-28-2004, 10:00 PM
Don't worry about it. I always thought Govtcheez was a girl.
Totally understandable mistake. :p

Brain Cell,
A big thing to keep in mind when dealing with large programs is that the particular details of a unit (say a single class) can wait to be put off for a while. What you really need to get nailed down is how it will interact with other parts of the code (essentially, the interface, but there is a bit more to it than that). The clearer the line of communication and the less communication there is amongst disjoint parts, the easier your life will be. The details of particular functions/algorithms are just that, details.

VirtualAce
11-28-2004, 11:06 PM
I don't know how big this is. I can't get MSVC to count the lines for me.

But so far this is one of the biggest projects I've worked on.

Zach L.
11-28-2004, 11:25 PM
Bah! Who needs editors?! Just write a little Perl script to do it for you. :)

gcn_zelda
11-29-2004, 05:27 PM
To write the program for you? ;-)

Zach L.
11-29-2004, 05:31 PM
I was suggesting counting lines, but if it'd write the program for me too, I certainly would not be averse to that. :)

jwenting
11-30-2004, 02:05 AM
Well i've been programming in C for a while but i've never had to write big programmer thats why im asking.


I'm a big programmer :)

Large programs are often written by teams, not single individuals.
If you count the entire team, the largest I've worked on was several million lines of code.
That was a 70 man team (about 25 of them programmers) working fulltime for 5 years on a codebase that had been purchased at several hundred thousand lines from another company, expanded and improved upon constantly.

Largest program I've done on my own and from scratch is probably 20k lines or so.

Of course as already stated KLOC doesn't mean anything.
At one point in a project where KLOC was taken as gospel the team I was a part of (that huge 70 man project was wisely split into 3-5 man teams each responsible for part of the system) was taking heat for producing a low KLOC count for a release (the customer had been promised 100K lines of code, we'd produced according to the count only -20K :) ).
Of course the count didn't take into account that we'd removed about 200K lines of dead code and written 80K lines of new code as well.

Focussing purely on KLOC makes for overly large code which is hard to maintain.
Focussing purely on keeping code as small as possible causes obfuscation which causes bugs and maintenance problems.

Zach L.
11-30-2004, 07:33 AM
The largest program I have ever written (still working some of the bugs out):


#include <iostream.h>

void main()
{
cout << "hello" + "world" << end1;
return 1.6; /* Returning approximation to the golden ratio means success
}

;)

VirtualAce
11-30-2004, 08:50 AM
A KLOC eh? You wouldn't happen to have worked for IBM? They use that term a lot, or at least used to. Especially in relation to how large their OS2 operating system was going to be.

Brain Cell
11-30-2004, 10:19 AM
Zach.L , jwenting and okrinus :
Thanks for the tips :)

jwenting
12-01-2004, 05:51 AM
Bubba, as it happens the company was purchased by IBM the year I left there (the one was unrelated to the other I assure you ;)).

Rez
12-03-2004, 12:59 PM
I've done programs programs with over 20,000 lines *without comments*. Nice technique to deter fools and to easily detect code piracy ;) My recent one was for my Electrical Engineering Fault Anlysis System --> (Circuit Analysis via Bus Impedance Matrix).

Oh yeeeeaaaahhhh...

bookworm
12-04-2004, 01:40 AM
My biggest program was written is C# on creating encrypted versions of files and their susequent decryption along with a few goody goody features such as separate accounts , web updates etc.