top | item 46844836

(no title)

fuzzy2 | 28 days ago

Inferred types are really great, but I feel they do not scale. Inside a method/function? Generally fine, but the signature, including the return type, had better be explicit.

Also, I think there was some performance issue with too much inference? Could be wrong, could also be fixed.

discuss

order

g947o|28 days ago

This. As soon as you need to use the type in another function (e.g. function parameter), you'll discover that it's better to just write it out.

epolanski|28 days ago

They do scale, but explicit types have two bonuses in my eyes:

1. can be read without a compiler, useful when reading PRs

2. They make the compiler work less, it's easier to check than infer