pnutzh4x0r@lemmy.ndlug.org to Programming@programming.devEnglish · 1 year agoLinear code is more readableblog.separateconcerns.comexternal-linkmessage-square45fedilinkarrow-up1107arrow-down114
arrow-up193arrow-down1external-linkLinear code is more readableblog.separateconcerns.compnutzh4x0r@lemmy.ndlug.org to Programming@programming.devEnglish · 1 year agomessage-square45fedilink
minus-squarerobinm@programming.devlinkfedilinkarrow-up1·1 year agoOne way to make it obvious which function can be called at which state is to use different type. Like UnbackedPizzà and CookedPizzà, and the bake function takes the former and returns the later.
One way to make it obvious which function can be called at which state is to use different type. Like
UnbackedPizzà and
CookedPizzà, and thebake
function takes the former and returns the later.