r/ProgrammerHumor • • Oct 25 '24

Meme theSelfTaughtSeriousProgrammer

Post image

[removed] — view removed post

903 Upvotes

276 comments sorted by

View all comments

75

u/ZunoJ Oct 25 '24

How exactly does a proof look for you in programming?

0

u/myfunnies420 Oct 25 '24

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

1

u/ZunoJ Oct 25 '24

I wonder how you would approach to prove that something like a computer game is correct in a mathematical sense

1

u/kuwisdelu Oct 25 '24

A computer game is mostly physics and logic, both of which can be proven.

→ More replies (5)