You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inappropriately named functions/variables should be changed to follow these rules:
Function names should reflect whether or not they update state (e.g. functions prefixed with check should not update state).
Nouns should be used to describe getter functions.
Verbs should be used to describe state-affecting functions.
State variable names should describe the class of data that the variable pertains to (e.g. prefix or postfix with ip when a variable only describes in-position data).
For example, check_card_config should be renamed to reflect the fact that it updates state through init_hands.
Additionally, there is currently a convention of state variables having either no postfix to mean "applies to out-of-position" and postfix _ip to mean "applies to in-position". Variables representing out-of-position traits should be postfixed with _oop to make this distinction clear.
The text was updated successfully, but these errors were encountered:
JacobVanGeffen
changed the title
Improve names for functions
Improve names for functions and state variables
Aug 15, 2024
I think that some of the _ip postfix vs no postfix isn't quite so straightforward. For instance PostFlopNode::num_elements is always the number of 'elements' the current player has, while PostFlopNode::num_elements_ip is the number of elements IP has, but only on the first node of a street.
Inappropriately named functions/variables should be changed to follow these rules:
check
should not update state).ip
when a variable only describes in-position data).For example,
check_card_config
should be renamed to reflect the fact that it updates state throughinit_hands
.Additionally, there is currently a convention of state variables having either no postfix to mean "applies to out-of-position" and postfix
_ip
to mean "applies to in-position". Variables representing out-of-position traits should be postfixed with_oop
to make this distinction clear.The text was updated successfully, but these errors were encountered: