soc@programming.dev to Programming Languages@programming.devEnglish · 4 个月前Library Design: Naming Conventions – Option & Resultsoc.meexternal-linkmessage-square3linkfedilinkarrow-up12arrow-down10
arrow-up12arrow-down1external-linkLibrary Design: Naming Conventions – Option & Resultsoc.mesoc@programming.dev to Programming Languages@programming.devEnglish · 4 个月前message-square3linkfedilink
minus-squaresoc@programming.devOPlinkfedilinkarrow-up1·edit-24 个月前Many languages’ Option and Result types suffer from an organically-grown and therefore inconsistently named set of functions that operate on them. We can do better! The article demonstrates how a full set of useful methods with predictable names can be derived from few, simple rules.
minus-squaremobotsar@sh.itjust.workslinkfedilinkEnglisharrow-up1·4 个月前 Pass and Fail You really wanted them to have the same number of letters, eh? Haha.
minus-squaresoc@programming.devOPlinkfedilinkarrow-up1·4 个月前Yeah, avoids pointless debates whether they should be lined up in matches or not. :-)
Many languages’
OptionandResulttypes suffer from an organically-grown and therefore inconsistently named set of functions that operate on them.We can do better! The article demonstrates how a full set of useful methods with predictable names can be derived from few, simple rules.
You really wanted them to have the same number of letters, eh? Haha.
Yeah, avoids pointless debates whether they should be lined up in matches or not. :-)