Imad
Imad

Reputation: 7490

Why autos and locals windows separate in Visual Studio

I was learning to debug and I came across these two windows. I find very few differences between them like locals show local variables in current scope autos display variables at current and previous lines. I wonder why visual studio kept them separate which looks confusing more things to learn and remember.

Upvotes: 5

Views: 1435

Answers (1)

Richard
Richard

Reputation: 109130

This is covered in the documentation:

The Autos and Locals windows show variable values while you are debugging. The windows are only available during a debugging session. The Autos window shows variables used around the current breakpoint. The Locals window shows variables defined in the local scope, which is usually the current function or method.

Where a function is longer and has many locals, having just a subset show can make things easier. Of course good practice is not have such functions that it makes a difference, but in reality there are a lot of functions that are too long out there.

Upvotes: 5

Related Questions