Here is my theory on an algorithm to build great software :
Figure out how the software ought to work.
This is the most important part in the software design process. It is important that the user experience be nailed down before we begin all other processes. If we don’t do this first, people will find the easiest way to make the software work. Such an approach may not deliver the best quality experience to the user. It is important to note that it is essential, to involve the users in this step. We need to clearly understand the problems they are facing. How should the optimal solution to their problem work ? Is it even possible with the available resources and at the current state of the art ?
Make it work
This is the part where you build the software according to the expectations set by the user. At this point you do not have to worry about code quality, performance etc.
Make it better
In this step you have to make sure that the code is extendable, has high quality tests and is secure
Make it pretty
In this step, make the software beautiful. Make the text conversational and friendly. Introduce fancy graphics and other visual elements if possible.
Make it fast
Finally it is time to seek out the worst performing parts of the software and make it fast.
If you follow these steps, and in that order, you should have a high quality piece of software in your hands.