phetsims / curve-fitting

"Curve Fitting" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
6 stars 3 forks source link

self code review #141

Closed pixelzoom closed 5 years ago

pixelzoom commented 5 years ago

Hi @SaurabhTotey. @ariel-phet asked me to do the final code review for Curve Fitting. Before that happens, you should run through the checklist yourself, using this issue. When you've completed the checklist, and the sim is ready for final code review, please create a "final code review" GitHub issue with this same checklist, and assign it to me. Let me know if you have questions about any of the checklist items.


Please mark failed items with

PhET code-review checklist

Build and Run Checks

Memory Leaks

Performance

Usability

Internationalization

Repository Structure

Coding Conventions

Type Expressions

Visibility Annotations

Because JavaScript lacks visibility modifiers (public, protected, private), PhET uses JSdoc visibility annotations to document the intent of the programmer, and define the public API. Visibility annotations are required for anything that JavaScript makes public. Information about these annotations can be found here. (Note that other documentation systems like the Google Closure Compiler use slightly different syntax in some cases. Where there are differences, JSDoc is authoritative. For example, use Array.<Object> or Object[] instead of Array<Object>). PhET guidelines for visibility annotations are as follows:

Math Libraries

IE11

Organization, Readability, and Maintainability

Accessibility

N/A

PhET-iO

N/A

SaurabhTotey commented 5 years ago

For

Does linting with "sim_es6_eslintrc_review.js" reveal any problems that should be fixed? (change eslintConfig in package.json and run grunt lint)

I fixed any lines that were much longer than 120 characters, but there are a few lines that run just a few characters over that I don't think need to be fixed. Furthermore, there are a few other lint issues regarding use of functions before declaration, but from what I can tell, it seems to be a pattern we are using in other places in the code base, so I didn't change those. Certain functions are declared after a class, but are used only internally within the class. If I should change that, please let me know.

pixelzoom commented 5 years ago

The 120-char limit is up to developer discretion. And sim_es6_eslintrc_review.js will be going away, see https://github.com/phetsims/chipper/issues/734. So I think you're totally fine here.