covid-sim icon indicating copy to clipboard operation
covid-sim copied to clipboard

Rename some parameters in Param.h

Open jieyouxu opened this issue 4 years ago • 2 comments

Rename multiple parameters in Param.h.

Currently using snake_case for struct Param in Param.h because there is evidence of multiple naming conventions for different parameters: PascalCase, camelCase, PascalCase_WithUnderscore, etc., can be changed if there is a official code style guide.

Refactor Scope

This PR is strictly restricted to parameter naming changes, and does not intend to refactor struct Param into smaller structs and enums. Future PRs are planned to split the work into multiple stages for easier review and testing. This PR should not change any type signatures and thus should not perform any semantic/behavioural changes.

This PR also attempts to minimize reformatting to minimize the diffs. A proper reformatting tool such as clang-format should be used as a follow-up PR to do an overall reformat due to changes in line length resulting from parameter name changes.

TODOs

  • Some parameter are not yet renamed, because:
    • I could not derive their intended purpose and units of measurement from existing documentation or from call sites / usage locations (some of them don't have documentation that I can find from docs/ or from other issues / PRs).
    • Still debating on a good name for the parameter.

Refactor Opportunities for Follow-up PRs

  • KernelType really should be an enum. It seems that KernelType also determines which function should be used, so a compile-time function lookup table might be useful here.

jieyouxu avatar Jun 08 '20 11:06 jieyouxu

I only renamed a subset of the parameters, more renaming can happen in follow-up PRs.

jieyouxu avatar Jun 09 '20 10:06 jieyouxu

From a previous conversation with @matt-gretton-dann

  • member variables are snake_case_ with trailing underscore
  • methods are snake_case()
  • classes / structs are CamelCase

zebmason avatar Jun 10 '20 19:06 zebmason