I might be committing code style crimes but I really like “Maybe” functions. As ...

@sinbad@mastodon.gamedev.place

I might be committing code style crimes but I really like “Maybe” functions. As in functions that might do a thing but might not, that I telegraph with a “Maybe” prefix so it’s not assumed. Often that wraps a function that *definitely* does the thing. It lets me simplify higher level flows by not having any conditionals there, and often callers don’t care about the optionality, only the overall sequence. But also it’s clear at the call site that it might not happen (eg caching, rejection)