« first day (4305 days earlier)      last day (698 days later) » 

2:23 AM
Still scratching my head at this.
 
2:59 AM
Brought to mind the "admittedly monstrous" expression a[(a=b)[3]]
 
 
10 hours later…
1:23 PM
Result of assignment operators

The assignment operators return the value of the object specified by the left operand after the assignment. The resultant type is the type of the left operand. The result of an assignment expression is always an l-value. These operators have right-to-left associativity. The left operand must be a modifiable l-value.
Could (and should probably) be re-written:
elem(v,u) = s;
elem(u,v) = -s;
elem(v,v) = c;
elem(u,u) = c;
something something rotation matrix.
 
1:40 PM
Yeah, I could parse out what it would do, the why one would do it that way was the head-scratcher. 😉
 
Yes. That's understandable. I wouldn't write it like that either. Somewhere in this library it's written something like "we're doing it like that because it appears to be the most optimal way to write it. whether it's still true needs to be tested."
 
1:55 PM
Optimal with respect to what? I'd be interested to know if the compiler flattens them both into the same assembly at the end of the day.
 
Me too. This code was probably written 12-15 years ago so it may have been "more optimal" in terms of cpu cycles back then, but I'm sure no profiler was involved in checking this.
 
When I started I was taught "if you want fast, switch to (possibly inline) assembly".
For me at least, it turned out to be a pretty good benchmark: "Do I need this fast badly enough that I'm willing to switch it to ASM? No? Okay, code as normal & move on."
 
I just can't imagine how the two would differ in the generated output. :/
 
2:13 PM
I wouldn't know either.
 
 
5 hours later…
6:56 PM
@DMGregory wait...visual scripting in unity? (https://gamedev.stackexchange.com/questions/200879/how-to-create-a-2d-array-in-unity-using-visual-scripting)

is this a third party plugin or did i fall asleep under a rock?
oh wow. available in 2021. Very cool
https://unity.com/features/unity-visual-scripting
 
7:50 PM
Used to be the third-party plugin Bolt, then they acquired and integrated it.
 
 
3 hours later…
10:34 PM
ah ok. I didnt realize they had already imported it into native unity. Thats excellent
 

« first day (4305 days earlier)      last day (698 days later) »