Hacker News new | ask | show | jobs
by pansa2 2335 days ago
Thanks for the reply - I wasn’t sure what Julia did in terms of type inference.

So, if not on local variables, where are explicit types necessary (other than function parameters)?

1 comments

You actually don't need explicit types in function parameters unless you're trying to control dispatching. Otherwise the compiler will auto-specialize on call. This blog post might be a better explanation on when it's necessary: https://www.stochasticlifestyle.com/type-dispatch-design-pos...