phetsims / pendulum-lab

"Pendulum Lab" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
4 stars 10 forks source link

Purpose of extra Planets.js enumeration? #54

Closed jonathanolson closed 9 years ago

jonathanolson commented 9 years ago

It seems cleaner to have this code within Planet.js:

Planet.EARTH = new Planet( .... );

and there would be no need for Planets.js.

Additionally, it seems like comparisons are being done with strings for planet names. It seems much cleaner to only do comparisons with Planet objects themselves (e.g. GravitySliderWithListNode.js would have planetProperty be a Property. instead).

Is there a reason why string literals are needed instead of comparing objects?

andrey-zelenkov commented 9 years ago

Remove Planets.js, refactor Planet.js. Reassign to @jonathanolson for verification.

jonathanolson commented 9 years ago

Looks great, thanks!