Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle debug code with constants rather that commenting it out #50

Closed
jbphet opened this issue Dec 9, 2014 · 3 comments
Closed

Handle debug code with constants rather that commenting it out #50

jbphet opened this issue Dec 9, 2014 · 3 comments
Assignees

Comments

@jbphet
Copy link
Contributor

jbphet commented Dec 9, 2014

There are a few locations in the sim code where code that is useful for debugging is commented out. PhET prefers to use a pattern where the code is still live, but is deactivated through the use of a constant. This prevents the code from being accidentally deleted during code cleanup, and makes the code more likely to be at least partially maintained as the other code in the file evolves.

For an example of how to apply this technique, please see beers-law-lab/js/concentration/view/DropperNode.js, and search on the string "DEBUG_ORIGIN".

Locations where this was seen as of this writing (this is probably not an exhaustive list):
ParticleWebGLNode.js line 267-272
ParticleWebGLNode.js line 141

@jbphet
Copy link
Contributor Author

jbphet commented Dec 9, 2014

Found during code review, see #29.

@AshrafSharf
Copy link

Debug code re-factored to use constants, similar to ab/js/concentration/view/DropperNode.js

@AshrafSharf AshrafSharf assigned jbphet and unassigned AshrafSharf Dec 17, 2014
@jbphet
Copy link
Contributor Author

jbphet commented Dec 17, 2014

Looks good, closing.

@jbphet jbphet closed this as completed Dec 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants