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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top