What is the difference between blue and black in debug mode?

Why is the text sometimes blue and sometimes black?

enter image description here

enter image description here

+6
source share
1 answer

I am very curious about this question and I did a little test.

I am not sure that what I observed was correct or not, but I checked it many times and got the same result.

Output:

I noticed that when you debug the code and the variable that the pop-up screen appears on, if it is still in use, I mean that having this variable is more important for the compiler than when displaying black text . But after the value of this variable is no longer required by the compiler, blue text will be displayed.

Example:

enter image description here

In the above image variable, fileName used in the second line (it is not visible because the pop-up screen overlaps it, you can see it in the next image) using the string variable, so the text here is black. But see the following image

enter image description here

Here you can see that the fileName variable fileName no longer used, and the debug pointer is at the end of the method. So the text turns blue.

Even in the console window, the text changes depending on the existence of the variable.

Link to the console screen of the first image:

enter image description here

Link to the second screen of the image console:

enter image description here

+4
source

Source: https://habr.com/ru/post/980022/


All Articles