What type would you expect for a function that takes a string of the form "123" and returns an integer?
I've seen str -> int (with an exception message), str -> option<int> (no info on what was wrong) and str -> result<int,int_error> (exposes all the error types to callers).
miniblog.
Related Posts
Agentic programming workflows rather remind me of genetic programming. The agent has a validation step that looks like a fitness function, and both run iterative trials.
I'm super impressed by how many lint rules can be implemented with just eslint's no-restricted-syntax and selectors. Example:
{
selector: "ExportNamedDeclaration[declaration=null][source=null]",
message: "Add `export` directly to the function instead of a block export."
}
I'm never sure how to convert words with hyphens into SCREAMING_SNAKE_CASE. For example, should built-in function be BUILT_IN_FUNCTION or BUILTIN_FUNCTION?