Here are two programs. One of them is worse than the other. Which one is it?
Manipulate[FactorInteger[a], {a, 1, 100000000, 1}]
Manipulate[factored[[a]], {a, 1, 100000000, 1}, Initialization :> (factored = Table[FactorInteger[a], {a, 1, 100000000}]),SynchronousInitialization -> False]
Hypothetically, the second program will perform slightly faster than the first. Realistically, the second program takes a long time to initialize. The first is rather zippy anyways. We can thus say that the second program is worse than the first. The lesson here is to not make a lot of unnecessary calculations.
What are some other examples of short, bad programs, and their superior replacements?