phetsims / build-a-nucleus

"Build a Nucleus" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
0 stars 5 forks source link

Add docs to implementation-notes.md about not needing to dispose much #177

Closed jbphet closed 1 year ago

jbphet commented 1 year ago

Related to code review, see #165.

There's a line item in the code review checklist that says, "Are there leaks due to registering observers or listeners? The following guidelines should be followed unless documentation (in-line or in implementation-notes.md) describes why following them is not necessary."

Very few of the link calls in the sim have accompanying unlink calls, but I think this is just the nature of the sim - there just aren't a lot of things coming and going. The only dynamic elements are the particles, and there is mention of them and their disposal functions in implemenation-notes.md. I'd recommend adding something to that same doc that says something like, "Other than particles, everything else pretty much stays around for the lifetime of the sim and therefore doesn't need to be unlinked or disposed".

To be clear, there's no need to add comments or change the code for this, as it's generally pretty clear why there aren't any unlinks.

zepumph commented 1 year ago

To be looped into #94

zepumph commented 1 year ago
Luisav1 commented 1 year ago

Added in the commit above. Closing.