What is the biggest program ever written?

Write a mathematical program in C and write something functionally equivalent in APL. Tell me that you still believe that SLOC is a good measure of complexity.

How about counting all of the Unix command line utilities (shells included) as one program and totting up the SLOC for all of that? That makes about as much sense as considering the Windows Vista kernel and all of its components as one program.

If any two components that communicate across an API can count as one program, then the largest program of all is the Internet.

Why would ya need to do that when all you need are a couple of nested loops? :wink:

(Then eventually the computer runs out of memory and crashes… :smiley: )

I have used that, it is sort of buggy.

A good optimizing compiler would probably replace a sequence of identical statements with a loop, so the computer wouldn’t run out of memory or crash trying to compile or run such a program.

MS Hello World V2.0

I agree it is a terrible one, but I wonder how many companies use it anyhow.

Well, Solaris (thought they didn’t say which version) was included on the list upthread, so that seems roughly equivalent to Windows. But I agree that how you define “program” is a bit fuzzy. If Firefox were in the running, would you count plug-ins or not? That’s a bit more reasonable than allowing anything that communicates through APIs. The compiler I wrote for my dissertation had a bunch of modules that communicated through files. (It was before the concept of API, and ran on Multics, and speed of coding let me get done faster and counted for a lot more than maintainability!) I’d call the whole thing one program - so that would open it up still further.

But, you see, that is what they’re doing. Firefox and its plug-ins communicate through APIs, the various bits of Windows communicate through APIs, shell programs communicate through APIs, and my browser and the webserver on the SDMB servers communicate through APIs. How well-defined those APIs are varies, but once you get into that it’s an infinite regress of hair-splitting.

I agree with Derleth. It’s a useless metric.

I can create a functional program that’s very UI-heavy in Visual Basic and only write a few lines of code. The same program in C on a Unix box where I’m writing each UI element could run into many thousands of lines of code.

When Martin Gardner wrote about John Conway’s cellular automaton game called Life in Scientific American magazine, a group of us thought it would be fun to see who could write the shortest program to run it. We defined the problem as a subroutine that accepted a matrix full of 1s and 0s to represent a single generation. Its output was a matrix representing the next generation, resized to have a single-cell border of zeros.

I don’t remember all of the exact numbers, but I do remember that the FORTRAN and COBOL versions were in the hundreds of lines. It was over a thousand lines in IBM/370 assembly language, and a hundred-something lines in BASIC. I got it down to a single line of code in APL (it was about 130 characters long). Others later produced a shorter single line of APL code.

We repeated this experiment in the late 90s and there was still an order of magnitude difference in number of lines between the verbose results in languages like Java and the results in dense languages like Perl.

Heck, even differences in programming style between two programmers writing in the same language can double or halve the number of lines of code (and it’s much more extreme in languages like Perl).

Any metric with a margin of error that big isn’t much of a metric.