pnutzh4x0r@lemmy.ndlug.org to Programming@programming.devEnglish · 2 years agoLinear code is more readableblog.separateconcerns.comexternal-linkmessage-square45linkfedilinkarrow-up1133arrow-down115 cross-posted to: [email protected][email protected]
arrow-up1118arrow-down1external-linkLinear code is more readableblog.separateconcerns.compnutzh4x0r@lemmy.ndlug.org to Programming@programming.devEnglish · 2 years agomessage-square45linkfedilink cross-posted to: [email protected][email protected]
minus-squarerobinm@programming.devlinkfedilinkarrow-up1·edit-22 years agoOne way to make it obvious which function can be called at which state is to use different type. Like UnbackedPizza and CookedPizza, 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
UnbackedPizzaandCookedPizza, and thebakefunction takes the former and returns the later.