Producing the desired output is the purpose of the program, but it's not the only consideration: there's performance, maintainability, security, and so on.