DaanHoogland commented on issue #4596:
URL: https://github.com/apache/cloudstack/issues/4596#issuecomment-792630655


   
   > ```
   > When to use a final variable :
   > 
   > The only difference between a normal variable and a final variable is that 
we can re-assign value to a normal variable but we cannot change the value of a 
final variable once assigned. 
   > Hence final variables must be used only for the values that we want to 
remain constant throughout the execution of program.
   > ```
   
   The above states that we must use `final` if we don't want variables to 
change. And though the `only` might imply that we must *not* use it otherwise, 
this is false. It is a soicial issue/dethat fensive programming to use final so 
that people have to make a conscious decision that change is allowed.
   
   > In addition, the indiscriminate use of FINAL makes it difficult to create 
unit tests
   
   which indeed would be a reason to make vars not final at times.
   
   > I would appreciate it immensely if you could technically explain to me why 
we use FINAL in this (incorrect) way throughout the project.
   
   as said above; social/defensive. The reasons only becomes technical when 
mistakes have been made.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to