Thank you Ravi for citing the performance angle. But for vast projects like Hotstar, Zee where multiple things are covered behind the scene, (though we interact with 2-3 screens usually), this 4ms matters. To achieve almost zero video start up time as well as smoothness of animations, we have to keep in mind 2 things 1. What to use (with proper reason) 2. Where to use I completely agree that it may not be matter for small or mis size projects. But for large projects, (my suggestion is) you should consider these small things. (Final keyword)
2 years ago (edited)
| 1
Removing Final keyword either would not have any benefits. It is about code standards and not always for a benefit.
2 years ago
| 3
I think if you are using final keyword to to viewmodel class…means you are telling ARC that class will use as direct dispatch …arc will not create any reference for that class in witness table… Correct me if i am wrong….
2 years ago
| 1
Code Cat
The use of final keyword with a viewModel bothered me a lot so I took my time to understand what does it do and really it does nothing and when used with a viewModel it simply adds no value.
Final is used with a singleton, utility classes but using it with a viewModel adds no value coz none would ever inherit a viewModel.
This thing is in trending these days coz everyone seems to be doing it but with a little research and technical lookup I can say that it just doesn’t add any value. Unless the team is looking for a microsecond win.
Don’t follow or implement anything blindly that you see on the internet, always ask questions.
Do you also use final with viewModel if yes please explain what benefits you got by using it? If there are none then remove the keyword
2 years ago | [YT] | 19