Strange Loop Conference · youtube · en-US
1Variable names can exhibit linguistic smells that are not structurally flawed but still indicate poor naming practices, such as using 'isValid' which suggests a Boolean return type but may misleadingly imply additional data like an internal ID.
“if you have an example like this where you have an external ID that is going to be validated, maybe we do some sort of conversion, right, you take our external ID like a customer number or student number, we try to convert it to an internal ID, something maybe we use in the database. If this conversion succeeds, then we have this internal ID, and we try to be smart, we don't just say here's True, we also give this internal ID back. This is easy because then in the call site, you have this ID that you can then use to query the database.”