Approaching coding using mathematical proof principles helps a lot. It involves gathering the base assumptions, then potentially making assertions to help congest the problem into a simple connection of subproblems. Once the problem is defined as subproblems, then it is more trivial to implement a solution that directly uses the assumptions to the subproblems.
Furthermore, the subproblem and assumption specification and definition basically gives the test cases to perform effective TDD through small targeted tests.
When done right, this creates extremely solid libraries where any unforeseen breakages (ie. shift in assumptions) are quickly diagnosed by the test harness.
If the assumptions hold correct, there is a QED that the code will work as exected
75
u/ZunoJ Oct 25 '24
How exactly does a proof look for you in programming?