Avoid Similar Variable Names
A common, problematic convention I see in Ruby tests are variable names like this: user_a = create(:user, last_log_in: today) user_b = create(:user, last_log_in: last_year) The idea is “we need two users to compare behavior against, so let’s make User A and User B.” In this post, I’d like to argue for variable names like this: frequent_user = create(:user, last_log_in: today) unengaged_user = create(:user, last_log_in: last_year) frequent and unengaged are not literal suggestion, but rather representatives of an idea. That idea is that such variables are visually distinct and carry more meaning. ...