- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Sveenth!
Admin
Snippet does not indicate is there could be documentation references elsewhere... Need to see the ENTIRE ALM environment. Perhaps the Git commit where theis was written is tied to a work item/ticket which contains a link.....
Admin
Who wants to bet that
self.points[-1]
would've been just fine for both cases with far less justifying arithmetic and far more compatibility with a future boss whose lucky number is 8?Admin
They know what the shape is. They know the tip is the seventh point.
Admin
Here it is: https://github.com/ManimCommunity/manim/blob/main/manim/mobject/svg/brace.py
Admin
I think, the problem is really that it's
self.points
, instead ofself.path
, which introduces this ambiguity, and not so much the comment.Regarding, "why represents the 7th point in this array the tip?", this should become obvious, once you have seen the shape. (Maybe the shape of a pen tip?) Should the comment discuss the shape of that element?
Admin
If they keep going over multiples of 7 they'll find the meaning of life the universe and everything ... eventually ;)
Admin
The seventh point of the seventh point ...
Admin
You wanna hot tip?
Admin
The number seven has magical properties in many ancient cultures. Were the comments in Assyrian or Aramaic?
Admin
Thanks... See that gives additional context, such as how "center point" was calculated (until it was deprecated and then later removed)
Admin
Indeed, "neither 34 nor 28 are seven". That's terrible. In my code I always make sure that both 34 and 28 are seven.
Admin
Admin
And it clearly shows it was yet another case of "update the code, but not the comment"...
Admin
It looks like a flattened 2D array to me (in the C sense of a 2D array, all elements sequential, not the array-of-pointers sense). So, in non-OpenGL mode, element 28 IS part of the seventh point, it’s just that each point has four coordinates stashed side by side in the array—so maybe the seventh point stores its X coordinate at 28, Y at 29, Z at 30, and W at 31, or something like that. It’s still the seventh point. That part doesn’t seem like a WTF to me.
Could it have been done better, using something like a struct, well, maybe, but maybe there isn’t an option to do that with this particular graphics API in Python.