I believe that's the joke:
"I wanted to write a short computer program but didn't have the time (so I wrote a long program instead)".
"I wanted to write a short computer program but didn't have the time (so I wrote a long program instead)".
Of course you are right, optimization does take time, whether you are optimizing a computer program or a letter.
But yes—just as applicable to computer programming as letter writing.
Things that are shorter or smaller generally take less time to produce than things that are longer or larger, it's a joke because the opposite is true in this case. Jokes can be true statements as well as falsehoods.