soc@programming.dev to Programming Languages@programming.devEnglish · 1 month agoLibrary 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 · 1 month agomessage-square3linkfedilink
minus-squaresoc@programming.devOPlinkfedilinkarrow-up1·edit-21 month agoMany 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·1 month ago Pass and Fail You really wanted them to have the same number of letters, eh? Haha.
minus-squaresoc@programming.devOPlinkfedilinkarrow-up1·1 month agoYeah, avoids pointless debates whether they should be lined up in matches or not. :-)
Many languages’
Option
andResult
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.
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. :-)