phetsims / wave-on-a-string

"Wave on a String" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/wave-on-a-string
GNU General Public License v3.0
7 stars 8 forks source link

Separate location for constants #24

Closed jonathanolson closed 10 years ago

jonathanolson commented 10 years ago

Certain constants (like the x,y coordinates for the left/right sides of the resting string, and anything used across multiple files or duplicated anywhere in code) should not be duplicated, and should live in one place in the code.

For constants that are used across files (numbers, colors, dimensions, transforms), I have a tendency to put these in a Constants.js (see https://github.com/phetsims/build-a-molecule/blob/master/js/Constants.js), but I'd be fine with them living in the most convenient place (a separate file may not be necessary for this sim).

For instance, 215 should only show up once when I do a search.