Computer Programming Principles/Methodologies/Reverse Programming

Reverse Programming is a process of coding an initial application or functional portion without an upfront design through an inventive top down process.

The method can be demonstrated using a simple math tree. First you start with your answer, say 9. Then you decide how you would arrive at 9, of the many possibilities you choose 4+5. Now you have 9=4+5. You can proceed to replace the 4 and 5 with a further math function. Suppose 4=2*2 and 5 = 3+2, so now the final formula would be 9=(2*2)+(3+2). The process can continue indefinitely. The point being is that you did not know up front how you would arrive at 9 but were able to start immediately without planning.

In the case of software development it is possible to start with the end result, at each stage of working backwards you can use constants and then replace those constants with functions or objects, etc.

The nice thing about this process is that it helps not to "over design" as the choice of each step backwards is usually the simplest.

Reverse programming was developed by William Egge by video recording his code edits and then reviewing them. He was inspired by the difficulty and being overwhelmed by complex problems and wanted an easier method that "flowed" without having to design up front.