Search
⌘K
    to navigateEnterto select Escto close

    Fully spell out variable names

    We fully spell out variable names.

    In the following case, variable p is used. Looking at the code, it takes the brain a few seconds to decipher that p is an instance of model.

    1validates_format_of :email, with: email_regex,
    2                  if: -> (p) { p.email.present? }

    Here is the same code with p fully spelled out.

    1validates_format_of :email, with: email_regex,
    2                  if: -> (patient) { patient.email.present? }
    Previous
    Next