phetsims / make-a-ten

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

Code Review Checklist (5/17/2015 snapshot) #2

Closed ariel-phet closed 7 years ago

ariel-phet commented 9 years ago

NOTE! Prior to doing a code review, copy this checklist to a GitHub issue for the repository being reviewed.

PhET code-review checklist

Build and Run Checks

Internationalization

Repository structure

   my-repo/
      assets/
      audio/
         license.json
      doc/
         model.md
         implementation-notes.md
      images/
         license.json
      js/
         my-repo-config.js
         my-repo-main.js
      .gitignore
      my-repo_en.html
      my-repo-strings_en.json
      Gruntfile.js
      LICENSE
      package.json
      README.md

For a common-code repository, the structure is similar, but some of the files and directories may not be present if the repo doesn’t have audio, images, strings, or a demo application.

   my-repo/
      js/
         common/
            model/
            view/
         custom
            model/
            view/
         introduction
            model/
            view/
         my-repo-config.js
         my-repo-main.js

Coding conventions

Documentation

Common Errors

Organization, Readability, Maintainability

Performance, Usability

// Cap large dt values, which can occur when the tab containing
// the sim had been hidden and then re-shown
dt = Math.min( 0.1, dt );

Memory Leaks

PhET-iO

samreid commented 9 years ago

Hi @AshrafSharf, @jonathanolson and I are thankful for the work you have done on this sim and very excited to get it published. One of the next steps will be to prepare the code for code review. Can you please review the code review checklist above, address any of the items that you can and ask questions about anything that is unclear? Please let me and @jonathanolson know when you are ready to discuss further.

AshrafSharf commented 9 years ago

on stringTest=double. The screen looks like this. Shall I just make the font size a function of number of characters. Would that be enough?

image

jonathanolson commented 8 years ago

Added some review issues after a brief (very incomplete) code review. Will plan to discuss when working with @AshrafSharf (but feel free to fix issues beforehand).

(Will do a full code review at a later undermined point).

jonathanolson commented 7 years ago

Make sure the string keys are all perfect, they are difficult to change after 1.0.0 is published. Strings keys should generally match the values, such as {binaryProbability: "Binary Probability"}. Screen names should use screen.screenName instead of camelcase. Message patterns and long paragraphs will also use a different pattern.

@samreid, is this style of key allowable:

  "game.info.level1":{
    "value":"Add single digit numbers to get sums of 10 and under."
  },
  "screen.explore":{
    "value":"Explore"
  },
  "next":{
    "value":"Next"
  },
samreid commented 7 years ago

Here are some key-value pairs and my recommendations:

{
  "make-a-ten.title": {  // perfect
    "value": "Make a Ten"
  },
  "screen.adding":{ // looks great
    "value":"Adding"
  },
  "screen.explore":{ // looks great
    "value":"Explore"
  },
  "screen.game":{ // looks great
    "value":"Game"
  },
  "make-a-ten.hide.total":{ // Why is this prefixed with "make-a-ten"?  It should be hideTotal
    "value":"Hide Total"
  },
  "make-a-ten.keypad.submit":{ // Why is this prefixed with "make-a-ten"?  Just use "submit"
    "value":"Submit"
  },
  "next":{ // good
    "value":"Next"
  },
  "game.info.levelX":{ // See image below:
    "value":"Level {0}"
  },
  "game.info.level1":{ // How about level1Description?
    "value":"Add single digit numbers to get sums of 10 and under."
  },
  "game.info.level2":{ // see level 1
    "value":"Add 9 to a single digit number to get sums between 10 and 20."
  },
  "game.info.level3":{
    "value":"Add single digit numbers to get sums between 10 and 20."
  },
  "game.info.level4":{
    "value":"Add with multiples of 10."
  },
  "game.info.level5":{
    "value":"Add double digit numbers and single digit numbers."
  },
  "game.info.level6":{
    "value":"Add double digit numbers with sums under 100."
  },
  "game.info.level7":{
    "value":"Add double digit numbers with sums over 100."
  },
  "game.info.level8":{
    "value":"Add single digit numbers to triple digit numbers."
  },
  "game.info.level9":{
    "value":"Add hundreds and multiples of ten."
  },
  "game.info.level10":{
    "value":"Add triple digit numbers."
  }
}

For patterns, we inherited this from our Java sims, even though it is ugly at least it would be consistent:

image

samreid commented 7 years ago

I think Arithmetic has a level pattern like the one you need.


  "pattern.level.0levelNumber": {
    "value": "Level {0}"
  },
jonathanolson commented 7 years ago

Additionally, is phet-io instrumention required now, as it's on the checklist?

samreid commented 7 years ago

I committed a change (see above) that clarifies that the PhET-iO checklist is only to be used for simulations that are already instrumented or should be instrumented.

jonathanolson commented 7 years ago

Everything except the assets (https://github.com/phetsims/make-a-ten/issues/250), performance (https://github.com/phetsims/make-a-ten/issues/251) and credits (https://github.com/phetsims/make-a-ten/issues/249) has been handled here.

Closing, as those are already in stand-alone issues.