Variable declaration Query

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi,

I recently came across a .net coding best practises
document which has the following suggestion
"Define frequently used local variables in first four
variables. Since there are direct instructions to load
first four variables, therefore these variables are always
fast compared to remaining variables"

Is it true? any references from Microsoft?

Thanks in advance
 
John said:
I recently came across a .net coding best practises
document which has the following suggestion
"Define frequently used local variables in first four
variables. Since there are direct instructions to load
first four variables, therefore these variables are always
fast compared to remaining variables"

Is it true? any references from Microsoft?

That sounds like the kind of thing which, even if it's true, should be
avoided for readability reasons except for the *very* few cases where
it makes a noticeable overall performance difference.
 
Back
Top