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

Misleading "click" naming in WaveInterferenceSlider.js #520

Closed
pixelzoom opened this issue Apr 16, 2021 · 4 comments
Closed

Misleading "click" naming in WaveInterferenceSlider.js #520

pixelzoom opened this issue Apr 16, 2021 · 4 comments

Comments

@pixelzoom
Copy link
Contributor

pixelzoom commented Apr 16, 2021

Noted while working on phetsims/fourier-making-waves#56, because I was told to use WaveInterferenceSlider.js as an example.

In WaveInterferenceSlider.js

const MIN_INTER_CLICK_TIME = ( 1 / 60 * 1000 ) * 2; // min time between clicks, in milliseconds, empirically determined
...
    // Keep track of the last time a sound was played so that we don't play too often
    let timeOfLastClick = 0;

Naming is really confusing here. If this did have something to do with "clicks", it would be better to call it "press", because click is mouse specific. And in fact it has nothing to do with click or press. It's the time between drag events.

Consider renaming for the benefit of future readers/maintainers.

@samreid
Copy link
Member

samreid commented Apr 16, 2021

I believe the clicks refer to the clicking sound that is made as you move across the slider tick marks. I'll update the documentation accordingly.

samreid added a commit that referenced this issue Apr 16, 2021
samreid added a commit to phetsims/ratio-and-proportion that referenced this issue Apr 16, 2021
@samreid
Copy link
Member

samreid commented Apr 16, 2021

I updated the documentation, but couldn't think of a superior variable name. @pixelzoom what do you recommend?

@pixelzoom
Copy link
Contributor Author

Doc in 409e3b5 looks OK.

phetsims/ratio-and-proportion@e0bf77f looks unrelated to this issue, probably an accidental commit.

Closing.

@samreid
Copy link
Member

samreid commented Apr 16, 2021

In phetsims/ratio-and-proportion@e0bf77f I noticed a copy/pasted version of the bad documentation, so I updated it at the same time.

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