Library Design: Naming Conventions – Option & Result

https://soc.me/languages/naming-conventions-option-and-result

2 points · 3 comments · view on lemmy.world

3 Comments

soc@programming.dev · 1 pts · 1y (2 replies)

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.

mobotsar@sh.itjust.works · 1 pts · 1y (1 reply)

Pass and Fail

You really wanted them to have the same number of letters, eh? Haha.

soc@programming.dev · 1 pts · 1y

Yeah, avoids pointless debates whether they should be lined up in matches or not. :-)