是否具有的变量命名约定

Variable naming convension for whether having

是否有变量,比如用户是否有积分,这个变量正确吗?

have_points、has_points、if_having_points 或 if_has_points?

保存布尔值的变量的命名约定应由前缀表示,例如:is、has、have、does、will、can 等

在您的案例中,您使用的是蛇形外壳。如果针对单个实体跟踪 "has Points",那么您可以使用 has_points。对于多个实体,您可能想要选择 have_points.

虽然归结为个人喜好,但您仍然应该尽量使您的代码简洁明了。