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
I hear people say that Go is often hard to search online (hence sometimes "Golang"), but the vast majority of language names are common words. Names with punctuation (C++, C#) are hard too.
Is this a big problem in practice? "Perl" isn't a dictionary word, but it's an exception.
Are there any FOSS licensees that explicitly allow people to train AI models on the source code?
This seems like a useful addition, and there's already precedent with the "classpath exception" for the GPL.
Python is discussing an elegant approach to tracebacks, where the subexpression that caused the exception is highlighted:
