I’m working on a small project and saw something that is confusing me. I am defining an ArcShape and setting the StartAngle but the debugger shows a different value than what I am setting.
A StartAngle of -1.57 (radians) should be -90 degrees and that is where the shape is being drawn. So what is the 4.71318… and where is it coming from?
Like I said, the code works correctly. I’m just curious about the source of that particular value.
Strange. I can also see it.
Looks now like the setter method in the frameworks do some math there. So they may add 2*pi there to move it in range 0 to 2*pi.
No bug, so no feedback needed.
Yeah, ok, but why? Like I said, the code does work correctly but I think the value shown in the debugger should, at least, reflect the value I set, shouldn’t it? If it wants to munge it under the covers, that’s ok (sorta) but my expectations are that what I set is what should be displayed.
anyway, at least the code does what it’s supposed to.
The value is normalized to range 0 to 2*pi. As your value is negative, 2 * pi is added.
Seems like the Xojo people like to have the value like this.
But we, as the programmers, certainly want our values to not be changed without even a warning.
Ok, here’s my issue with it. While what they are displaying may be mathematically correct it is very misleading when they show a value other than what I, the programmer, specify. That said, I don’t intend to write a feedback report since the code actually works properly and I don’t want to take the chance they may break something else.
It’s the same value, just in a different form.
A potato / potato thing …
Yes, in this context; but it can stay as entered (-1.57 is still the same value which doesn’t need to be “updated”).
This is like this example:
Var s as string=“The table”
//The debugged shows s=“Das Tisch” because it’s the same thing (in german).
If you set a property, you mostly expect it to be kept like that.
The thing I “object” to is not that you want it to be shown as entered, but the use of the word “value”.
Maybe it’s the Scientist in me, but it grates on my brain when people talk about something but mean something else (my pet peeve is when even American Scientists talk about Evolution and Development as if they are interchangeable - they are completely different things … and they usually use the wrong one for a given context)
Even scientifically, if you set an angle of -90° (degrees) or 270° to an object, they are the same; still, finding -90° has turned to be 270° because “something knows better” is unexpected.
IMO everything above is a “value”.
Maybe @Paul_Lefebvre can document the behavior here:
Otherwise whether they do normalization of the angle in setter (as now) or later when drawing (as you would prefer), should not make a difference.
If you are familiar with HTML and CSS: there you have the distinction between the data values and their presentation/formatting. You should not use “value” when you mean its representation.
e.g 3.14159… is the same as π, 0.5 is the same as 1/2 etc - they are simply two different representations of the same value.
Then I think the representation shouldn’t change without good reasons.