📜 ⬆️ ⬇️

Mysterious signs in the fields - solution

So, time for the correct answer to the previously published puzzle . Thanks to everyone who participated. The first comment on the post was posted this link . I confess that I believed that it would not appear immediately and would allow a little to extend the intrigue. But Habr is Habr and for every tricky nut there will be a bolt with a left-hand thread - and that's fine, for that we love him.

However, the competition was not so simple, so that it could be won only with a reference to MSDN - only signs 1, 2, 3, 7 and 8 are explained. But what they mean and how 4, 5 and 6 differ from each other - in this and there was the task itself. Unfortunately, many found the first comment the right answer and refused to participate further. And in vain. I ask under the cat.

Since icons 1, 2, 3, 7 and 8 correctly explained almost everything, let's move on to the most tricky one - lines 4, 5 and 6. Many guessed that the images in these variants are a combination of a breakpoint and a tracepoint set to the same line. At this point, the question from the gallery was “How can you put both types of points on one line, because after installing any of them, the point of setting the second type points disappears in the context menu of the line?” The only way I know how to do this is to put breakpoint and tracepoint on different lines, and then for any of them open the context menu, select the “Location” item and in the opened dialog box manually specify the line of the second point. This leads to the appearance of such icons, as in lines 4, 5 and 6.


')
But wait! Why do the signs differ, for example, in lines 5 and 6? And why in the task it was said that signs 4 and 6 are also different and mean different things - because they look so much like the view! And here we came to the conclusion that it was impossible to google or subtract to MSDN. Before us is nothing like 2 bugs in Visual Studio - one of them is allowed by programmers, and the second by designers. Moreover, they are present in all versions of Visual Studio known to me (2005 \ 2008 \ 2010).

Programming bug

In lines 5 and 6 are exactly the same thing. Each of them has exactly one simple active breakpoint and exactly one simple active tracepoint. Breakpoints and traces for both lines were added in the same way and in the same order (first breakpoint by F9, then tracepoint to the next line, then transferring the tracepoint one line back) are tied to the same symbol in the line (first). Nevertheless, Visual Studio in one case draws a circle over a rhombus, and in the second, on the contrary, forcing people to make wild assumptions about the importance of the order in which points are set, their priority, or the order in which they are triggered. And this is just a bug in the icon drawing algorithm.

Designer bug

And here we come to the main intrigue - what is the difference between the icons in lines 4 and 6? We already know what is in line 6 (breakpoint + tracepoint). But in line 4 is exactly the same thing, with only one difference - tracepoint is in the disabled (disabled) state. If he was on top, we would clearly see an unfilled rhombus, but it is an infection from below, and therefore the only thing that can visually tell us that its off state is the color and shape of the rhombus tops, which slightly protrude beyond the boundaries of the circle. The fact that they are really different is noticeable in Visual Studio if you click on the on / off checkpoint of the trace point and look at the icon significantly - almost every person’s eye notices a change in color, although 9 out of 10 people will look at icons in a static state that they are the same.



I will never believe that this madness was done on purpose - most likely both this bug and the previous one are simply the result of the fact that nobody specifically designed, wrote, or tested the situation “breakpoint + tracepoint” at all. It just somehow works by chance, but no one gets a hand to bring it all to mind - there are more pressing tasks.

Salute, champagne and announcement of the winner


A lot of people gave 6-7 correct answers out of 8. These are very good results. However, the winner is recognized by this answer on Twitter from a person with a nickname Yanzay . He first clearly emphasized the details described above: disabled tracepoint + active breakpoint in line 4, as well as the actual identity of the stop and trace points in lines 5 and 6 (both normal, in the active state). The limitations of Twitter here played into his hands - there was not enough space to write too much (this prevented some of them), and the right answer was given. Congratulations! During the day, I’ll tweet the winner on Twitter about awarding the invite.

UPD invite sent.

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


All Articles