Given the choice between a docstring and a type signature, I find a docstring much more helpful on the first read (ideally I'd have both!)
miniblog.
Related Posts
TIL that PGP keyservers no longer support 'web of trust' chains of signatures, as they were being spammed by people uploading massive signature chains:
Anecdotally, I've noticed more frequent doc comments in languages that put them inside the function (e.g. Python, Lisp) rather than outside (JS, Rust).
Perhaps it's easier to write the rough signature before the explanation?
I refactored some Rust string splitting logic:
old: &[&str] -> Vec<String>
new: &[&str] -> Vec<&str>
It's a little faster, but it's an interesting type signature. You can figure out more of how the new one works! It must be slicing into the input string.
