-
Notifications
You must be signed in to change notification settings - Fork 28
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
location vs position #126
Comments
Please identify. |
For example, https://github.com/phetsims/energy-skate-park/blob/d1a734a7021646104afc2af1f95e7de97625db8f/js/energy-skate-park/common/view/EnergySkateParkTimerNode.js refers to By the way, I'm in progress working through phetsims/gas-properties#170 and we'll have opportunities to fine tune the naming after initial commits. |
Most notably, DragListener has |
Personally, I don't care if we standardize on this. I'd be happy to leave it up to developer discretion as to whether to use 'location' or 'position'. I realize that creates a bit of inconsistency in the PhET-iO API, but I think the cost to clients will be significantly less that the cost for PhET to standardize. My 2 cents... What I do care about is arbitrary changes to existing code based on personal preference, like this one in common code: this.positionProperty = new Vector2Property( options.location, { This was originally |
12/19/19 dev meeting:
Assigning to @samreid to review existing cases and decide on whether we need an assertion. |
The renaming for balloons and static was more invasive than I expected it to be, so I consulted with @jessegreenberg about a few aspects. (1) cases like const POSITION_DESCRIPTION_MAP = {
AT_LEFT_EDGE: {
UPPER_PLAY_AREA: landmarkLeftEdgeString,
CENTER_PLAY_AREA: landmarkLeftEdgeString,
LOWER_PLAY_AREA: landmarkLeftEdgeString
}, And @jessegreenberg confirmed that our decision to use position instead of location did not just apply to cartesian coordinates, but should also apply to cases like this. (2) we confirmed that even though a11y key and string placeholder names were changed, no a11y text values were changed, so this shouldn't change anything for the end user. Fuzzing and linting was clear, so I'll commit this part. |
Hmmm... I hadn't thought about translated strings (or their keys). Searching for case-insensitive occurrences of "location", I find 233 in "*strings*.json", 75 in "*A11yString.js". What do you propose to do about these? |
I was going to respond to @pixelzoom and request that string keys not be changed, but I looked at this a bit and all occurrences of "location" seem to be in translations with no corresponding string in the English file. I'm not quite sure what's going on here. There's a commit - phetsims/energy-skate-park-basics@3e68965 - where the strings with "location" in their keys were removed from the strings file, but how did they end up getting translated? Rosetta is specifically designed to only present to the user strings that are used in the sim. Perhaps the bottom line is this - if @samreid or @jessegreenberg can confirm that these strings are not used in the currently live version of the sim, nor in the master version, the string keys in question in the translated string files can be changed, left alone, or removed from the translations files, since they will have no effect on the translated sim. EDIT by @pixelzoom: I've create phetsims/energy-skate-park#171 to track what to do (if anything) about energy-skate-park string files. |
I attempted to change "location" to "position" in Natural Selection. It's a new sim, so I figured it would be appropriate to address immediately. I ended up introducing a bug in DataProbeDragListener, reverted in the commit above. DataProbeDragListener is a subclass of DragListener, which has option class DataProbeDragListener extends DragListener {
constructor( positionProperty, ..., options ) {
....
options.locationProperty = positionProperty; // YUCK!!!
super( options );
....
} I'm not wild about either of these alternatives. Assigning to @ariel-phet and putting this back on the developer meeting schedule to discuss when common code will be converted. It's been 19 days since we decided to make this change, and nothing has been done. What's the plan? |
Based on a search for "location" (case insensitive) here's what needs to be revised, see checklists below. Note that this change isn't limited to Property names. It also applies to method names, variable names, constant names, comments, .... Changes may also result in PhET-iO API changes, requiring rebuild of API files. Imo, common-code should be done first and ASAP - see my DragListener experience in #126 (comment). Sims can be done "chip away". Common Code:
Sims:
|
When do we use position vs location? Some cases seem haphazard
Jesse Greenberg 3:14 PM
Chris Malley 3:46 PM
This came up during phetsims/gas-properties#170 when I noticed that some stopwatches used
locationProperty
and some usedpositionProperty
.The text was updated successfully, but these errors were encountered: