The problem I see with lateinit is that your prope...
# android
a
The problem I see with lateinit is that your property is not immutable, I still prefer to use lazy delegate with no thread safety argument
r
@alex.tavella Making something immutable isnt the usecase for lateinit . But when it comes to instaniating views why would you want it to be immutable knowing how android's lifecycle works... i think the best solution is to use what has less overhead. Lateinit should always be choosen over delegate lazy when it comes to view variables.
a
Does the view references really leak if you use lazy delegate? Regarding to lazy delegate overhead, it is only on first call right? It should be better than call findViewById everytime (which I suppose is what android extensions does behind the scenes)
a
`Kotlin Android Extension`calls
findViewById
only once and for further calls it gets the view from cache
👍 1