4 ms·
Taking the opportunity to point out, with most inferred type languages (mypy python, go, TS, rust, scala), you often don't have to write variable types at all,
by kortex 5y ago
Taking the opportunity to point out, with most inferred type languages (mypy python, go, TS, rust, scala), you often don't have to write variable types at all, only functions. Gone are the days of `Foobar foob = new Foobar`, heck C++ has had `auto` for a decade.
So have your dynamic language functions you have to document (you do document your code right?), why not just use types instead? I'd far rather see
def frob(data: np.ndarray) -> float:
<code with no docstring>
than
def frob(data):
"""takes an array and frobs it to give the frobitude score"""
Like, idk about you, but the former is way better at "self documenting" and you can do all kinds of automatic operations on it. If things are ill-defined and quickly shifting, I can mypy and flake my way to make sure the stack works without bricking something. If I have human docs, that's far more likely to drift out of date.
- aYsY4dDQ2NrcNzA 5y agoAt least call it frob_score.