11
halfflat
245d

'Epiphany' might be overstating it, and it's something I realised a long time ago, but it's been invaluable in the years since.

When designing an interface or an abstraction or a data structure, everything is going to be easier in the long run if you can map it to a mathematically simple idea. Documentation, validation, bug fixing, interaction with other components — everything.

Contrapositively, if a piece of code is a horrible bug magnet, or hard to describe, or full of special cases — these things tend to go together — then chances are it doesn't model a logically simple concept.

Even mathematicalizing something like recursion as the limit of something like 'let g = f in f g' — making explicit something that is implicitly complicated — can provide both a cleaner API and more control over the process of execution.

Comments
  • 1
    sounds interesting. could you provide an example? i can not think of one but would like to understand.
  • 0
    @erroronline1 Probably related to set theory and/or discrete math.
  • 1
    This reminded me of Finite State machines. How we convert a statement into a set of if else checks to get the solution
  • 0
    You overestimate your average dev's math skills.
Add Comment