-
Notifications
You must be signed in to change notification settings - Fork 14
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
add _.extend to bad sim text? #805
Comments
We should decide if this is really forbidden in sim text, marking for dev meeting. |
When I have full control over the args, and I know that // options shared by all Rectangle instances
const RECTANGLE_OPTIONS = {
stroke: 'black',
lineWidth: 2,
cornerRadius: 3
};
const redRectangle = new Rectangle( ..., _.extend( { fill: 'red' }, RECTANGLE_OPTIONS );
const greenRectangle = new Rectangle( ..., _.extend( { fill: 'green' }, RECTANGLE_OPTIONS ); |
I think that is reasonable, but I also see value in having an established pattern. If everything is the same, it may be a bit easier for the project as a whole. I also think that there is a point to be made about maintainability. In the example above, it is currently harmless, but perhaps in the future Rectangle will add in a nested set of options, like Again I don't feel strongly about this. |
It doesn't become any harder (and in fact doesn't change) because I have full control over all of the args. If my args are unchanged, then it's irrelevant whether Rectangle takes nested options or not, I need to change nothing. If I'm not using nested options, I can use |
We could change |
I'm seeing a common trend where we find something of general use in phet-core (i.e. most of phet-core) and it's "I wish we didn't have to use a require statement" and "I wish I could use this in other preloads, but it's in require.js". Should we consider moving some core code into a preload that is outside of the require.js system? |
I'm up for making it easy for the entire team, but thought I should mention it doesn't bother me to add the require statement. I use shift-option-cmd-R to automatically add require statements and it has been working well for my situation. |
We will go with adding |
Lint rules added above. Only a few had crept in since the conversion. I'm glad to have added these now. Closing. |
phetsims/phet-core#71
The text was updated successfully, but these errors were encountered: