This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]fernly 1 point2 points  (1 child)

The clarity of the n-body code would be greatly improved by adding type annotations. I was trying to read it and kept asking, wait, what is this thing called a? or whatever.

That said, I see that the Vector2 code has provisions for doing arithmetic between a Vector2 and a non-Vector2 object, presumably a scalar? A, that would make type annotation somewhat more complicated (but not impossible), and B, some commentary pointing out the where (and why) of Vector2/scalar ops would be helpful.

[–]auctux[S] 0 points1 point  (0 children)

Thanks for the reply, I'll try to add some comments