Skip to content

Commit

Permalink
add more info to design principles on internal function naming and ex…
Browse files Browse the repository at this point in the history
…ception, relates #344
  • Loading branch information
joshwlambert committed Aug 14, 2024
1 parent dcdab5d commit f4ba92a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vignettes/design_principles.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Other functions return the simplest type possible, this may be an atomic vector

* The package uses S3 classes and S3 dispatch for exported functions, and `switch()` and `do.call()` for dispatching to internal functions. This is because it is easier to develop and debug internal functions that do not use S3 dispatch and avoids having to ensure that S3 methods are registered. Examples of S3 dispatch for exported functions are `get_parameters()` and `convert_summary_stats_to_params()`. Examples of internal dispatch using `switch()` and `do.call()` are `clean_params()` and `convert_params_to_summary_stats.character()`.

* The function naming convention is for internal functions to have a dot (.) prefix (e.g. `.convert_params_lnorm()`).
* The function naming convention is for internal functions to have a dot (.) prefix (e.g. `.convert_params_lnorm()`). The only function that breaks with this convention is `new_epiparameter()` as advanced users of the package may want to call in the internal low-level constructor, and adding a dot prefix to this function may make it harder for users to find.

## Dependencies

Expand Down

0 comments on commit f4ba92a

Please sign in to comment.