On another note, I once REMOVED around 23K lines of code from a program without affecting any functionality - and it wasn't "dead" code, either. I merely changed thousands and thousands of very "similar" code blocks that used hard-coded values into just couple of dozen subroutines that used variables passed on the Calls instead. Even so, the resulting program still had over 40K lines of code left.
And I once did the exact opposite of that. I took a small routine and exploded it into thousands of lines of code in the QBDbase library.
My original sort routine started out like:
FOR I = 1 TO LIMIT
FOR J = 1 TO LIMIT
SELECT CASE MemType
CASE INTEGER: 'set MEM compare size to 2 bytes
CASE SINGLE: set MEM compare size to 4 bytes
and so on for each type...
END SELECT
Compare values/ swap if needed...
NEXT
NEXT
The only issue was the speed of the routine was unacceptable from doing the select case and signed/unsigned decision making and calculations, so the solution was to restructure:
SELECT CASE MemType
CASE Integer
FOR I =.....
FOR J = ......
Compare/Swap Values
NEXT
NEXT
CASE Single
FOR....
FOR.....
The Select Case moved outside the 16? (I think 16) different sorting routines, and each case had its own sort process to it, which ended up exploding a crapload of lines into the routine.
The plus side to the whole thing, however, was that by removing such decision making and computations to the OUTSIDE of the sort loop, the sort times dropped from hours/minutes to seconds/milliseconds.
In this case, smaller wasn't better, which I thought was worth pointing out since most programmers instantly seem to think, "few lines = better code", and that may not always be true. ;)