phetsims / build-a-nucleus

"Build a Nucleus" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
0 stars 5 forks source link

Suggestions for improving the documentation style #173

Closed jbphet closed 1 year ago

jbphet commented 1 year ago

Related to #165. I received some feedback in a code review a while back about inconsistent use of sentence fragments, punctuation, etc. See https://github.com/phetsims/number-line-operations/issues/54. I'm seeing the same issue in the comments for this sim. Here is a short example. Note that the first comment is a fragment, which is fine, the second is a full sentence with capitalization, also fine. The third is a complete sentence written as a fragment.


  // the final mass and final proton number of a nuclide after a decay is done
  public readonly finalProtonNumberProperty: Property<number>;
  public readonly finalMassNumberProperty: Property<number>;

  // This cell (if available) holds all info about the initial mass and decay type.
  public readonly currentCellModelProperty: Property<NuclideChartCellModel | null>;

  public constructor( cellModelArray: NuclideChartCellModel[][], protonCountProperty: TReadOnlyProperty<number>, massNumberProperty: TReadOnlyProperty<number> ) {

    // keep track of the current nuclide cell to update the decay equation
    this.currentCellModelProperty = new Property( this.getCurrentCellModel( cellModelArray, protonCountProperty.value, massNumberProperty.value ) );

The inconsistencies in the style requires more cognitive effort for readers to interpret.

I made the changes that were suggested in https://github.com/phetsims/number-line-operations/issues/54 and it took less time then I thought it would, and I feel that it improved the code. I know PhET has no standard for this, but I thought I'd put it out there for consideration.

Luisav1 commented 1 year ago

Thank @jbphet, that's a great suggestion. This was addressed in the commits above. Closing.