I feel like it’s being redundant if it can be infe...
# random
s
I feel like it’s being redundant if it can be inferred from the initializer.
a
One use case may be when you want to hide an implementation behind an interface
s
Okay, I will think about this.
But in general I think it’s best to not repeat?
like var moveCounter = 0
vs. var moveCounter: Int = 0
a
Yes - I'm really only using them for a) interfaces and b) when dealing with platform types.
s
good to know
r
If you're writing a library it's often good to specify all public types explicitly. 1.4+ even includes an "Explicit API Mode" in the compiler to enforce this (among other things). https://kotlinlang.org/docs/reference/whatsnew14.html#explicit-api-mode-for-library-authors
s
looks like the link is broken
r
Fixed
👍 1
s
Looks promising @Ruckus
r
Why is it considered good though?
s
I’d say more rigorous static checking by the compiler?