In cases where I'm writing a function before it is used anywhere, I'm finding it useful to add type annotations to its parameters. This means I can autocomplete on its values and (especially as an F# newbie) won't get confused by unexpected type inference.
However, once the function is finished, I'm tempted to remove the parameter's type annotations because they're ugly. Does this sound like a reasonable thing to do?
I expect that it might depend on what kind of function I'm talking about. For example it might make sense for a private function, but not for a public one.
I think it depends on lots of factors. Here are a few arguments in favor of leaving the annotations:
However, on the other hand, there are also some compelling reasons to remove them:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With